diff --git a/Cargo.lock b/Cargo.lock index 1334ea8..1e2c410 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2883,7 +2883,7 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "llama_cpp" version = "0.3.1" -source = "git+https://github.com/edgenai/llama_cpp-rs?branch=main#9c098a769785738deb5e0179ad2c5e5554d1cb43" +source = "git+https://github.com/edgenai/llama_cpp-rs?branch=main#491f69a868a3fb6169501359870bb0649f45069f" dependencies = [ "derive_more", "futures", @@ -2897,7 +2897,7 @@ dependencies = [ [[package]] name = "llama_cpp_sys" version = "0.3.1" -source = "git+https://github.com/edgenai/llama_cpp-rs?branch=main#9c098a769785738deb5e0179ad2c5e5554d1cb43" +source = "git+https://github.com/edgenai/llama_cpp-rs?branch=main#491f69a868a3fb6169501359870bb0649f45069f" dependencies = [ "ash", "bindgen", diff --git a/crates/edgen_rt_llama_cpp/src/lib.rs b/crates/edgen_rt_llama_cpp/src/lib.rs index a4ff332..1ca1874 100644 --- a/crates/edgen_rt_llama_cpp/src/lib.rs +++ b/crates/edgen_rt_llama_cpp/src/lib.rs @@ -259,7 +259,9 @@ impl UnloadingModel { .map_err(move |e| LLMEndpointError::Advance(e.to_string()))?; let sampler = StandardSampler::default(); - let handle = session.start_completing_with(sampler, SINGLE_MESSAGE_LIMIT); + let handle = session + .start_completing_with(sampler, SINGLE_MESSAGE_LIMIT) + .map_err(|e| LLMEndpointError::Advance(e.to_string()))?; Ok(handle.into_string_async().await) } else { @@ -276,7 +278,9 @@ impl UnloadingModel { id.advance(new_context); let sampler = StandardSampler::default(); - let handle = session_guard.start_completing_with(sampler, SINGLE_MESSAGE_LIMIT); + let handle = session_guard + .start_completing_with(sampler, SINGLE_MESSAGE_LIMIT) + .map_err(|e| LLMEndpointError::Advance(e.to_string()))?; (session_signal, handle) }; @@ -581,7 +585,9 @@ impl CompletionStream { ( session_signal, - session_guard.start_completing_with(sampler, SINGLE_MESSAGE_LIMIT), + session_guard + .start_completing_with(sampler, SINGLE_MESSAGE_LIMIT) + .map_err(|e| LLMEndpointError::Advance(e.to_string()))?, ) }; @@ -605,7 +611,9 @@ impl CompletionStream { .advance_context_async(new_context) .await .map_err(move |e| LLMEndpointError::Advance(e.to_string()))?; - let handle = session.start_completing_with(sampler, SINGLE_MESSAGE_LIMIT); + let handle = session + .start_completing_with(sampler, SINGLE_MESSAGE_LIMIT) + .map_err(|e| LLMEndpointError::Advance(e.to_string()))?; Ok(Self { handle: handle.into_strings(),