feat(backend): fix when num_cores_per_instance is equals to zero with the size of the generated core allocation

This commit is contained in:
Morgan Funtowicz 2024-11-28 14:53:35 +01:00
parent 8e89793514
commit 298367cdfd
1 changed files with 1 additions and 1 deletions

View File

@ -176,7 +176,7 @@ impl LlamaCppBackend {
// Allocate all the workers // Allocate all the workers
let cores_allocation = get_cores_allocation(num_cores_per_instance as usize); let cores_allocation = get_cores_allocation(num_cores_per_instance as usize);
cores_allocation.iter().for_each(|affinity| { 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) => { Ok(worker) => {
let tokenizer = Arc::clone(&tokenizer); let tokenizer = Arc::clone(&tokenizer);
let affinity = affinity.clone().collect::<Vec<_>>(); let affinity = affinity.clone().collect::<Vec<_>>();