This commit is contained in:
parent
33cb8fe1e3
commit
90d2897dee
2 changed files with 11 additions and 7 deletions
|
|
@ -21,11 +21,7 @@ compile_error!(
|
|||
"Only one compute backend can be used, choose feature `vulkan`, `openmp`, or `cuda`!"
|
||||
);
|
||||
|
||||
#[cfg(not(any(
|
||||
feature = "vulkan",
|
||||
feature = "openmp",
|
||||
feature = "cuda"
|
||||
)))]
|
||||
#[cfg(not(any(feature = "vulkan", feature = "openmp", feature = "cuda")))]
|
||||
compile_error!(
|
||||
"Choose feature `vulkan`, `openmp`, or `cuda` to select what compute backend should be used for inference!"
|
||||
);
|
||||
|
|
|
|||
|
|
@ -723,9 +723,17 @@ async fn document_processor(
|
|||
{
|
||||
let mut model_singleton = MODEL_SINGLETON.lock().await;
|
||||
if model_singleton.is_none() {
|
||||
let max_ctx = if config.max_ctx == 0 { None } else { Some(config.max_ctx as u32) };
|
||||
let max_ctx = if config.max_ctx == 0 {
|
||||
None
|
||||
} else {
|
||||
Some(config.max_ctx as u32)
|
||||
};
|
||||
*model_singleton = spawn_blocking(move || {
|
||||
LLModelExtractor::new(Path::new(&model_path), config.num_gpu_layers, max_ctx)
|
||||
LLModelExtractor::new(
|
||||
Path::new(&model_path),
|
||||
config.num_gpu_layers,
|
||||
max_ctx,
|
||||
)
|
||||
})
|
||||
.await
|
||||
.map_err(|err| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue