From 298367cdfd2f33cc9699b2748f1d8edfbf3c66e1 Mon Sep 17 00:00:00 2001 From: Morgan Funtowicz Date: Thu, 28 Nov 2024 14:53:35 +0100 Subject: [PATCH] feat(backend): fix when num_cores_per_instance is equals to zero with the size of the generated core allocation --- backends/llamacpp/src/backend.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/llamacpp/src/backend.rs b/backends/llamacpp/src/backend.rs index 557c14b4..e662e207 100644 --- a/backends/llamacpp/src/backend.rs +++ b/backends/llamacpp/src/backend.rs @@ -176,7 +176,7 @@ impl LlamaCppBackend { // Allocate all the workers let cores_allocation = get_cores_allocation(num_cores_per_instance as usize); cores_allocation.iter().for_each(|affinity| { - match Self::allocate_worker(path, num_cores_per_instance as u32) { + match Self::allocate_worker(path, affinity.len() as u32) { Ok(worker) => { let tokenizer = Arc::clone(&tokenizer); let affinity = affinity.clone().collect::>();