From eb34850a5ed2d4750ad04205de561f55c99d6f92 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Thu, 2 Nov 2023 16:15:06 -0700 Subject: [PATCH] fix: output err if step failed --- crates/llama-cpp-bindings/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/llama-cpp-bindings/src/lib.rs b/crates/llama-cpp-bindings/src/lib.rs index 1c96016..5bd33d1 100644 --- a/crates/llama-cpp-bindings/src/lib.rs +++ b/crates/llama-cpp-bindings/src/lib.rs @@ -74,8 +74,9 @@ impl AsyncTextInferenceEngine { let mut engine = self.engine.lock().await; - let Ok(result) = engine.as_mut().unwrap().step() else { - panic!("Failed to evaluation"); + let result = match engine.as_mut().unwrap().step() { + Ok(result) => result, + Err(err) => panic!("Failed to step: {}", err), }; for ffi::StepOutput { request_id, text } in result {