From bc935dc3ce43f4fc0d1ba4d563389a5c8f9736f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Thu, 6 Feb 2025 18:43:50 +0000 Subject: [PATCH] Cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- backends/llamacpp/src/backend.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/backends/llamacpp/src/backend.rs b/backends/llamacpp/src/backend.rs index dd873f6e5da..1806c7c1d5a 100644 --- a/backends/llamacpp/src/backend.rs +++ b/backends/llamacpp/src/backend.rs @@ -342,10 +342,12 @@ impl LlamacppSampler { error!("Failed to init sampler"); return None; } - let top_k = unsafe { llamacpp::sampler_init_top_k(req.top_k) }; - let top_p = unsafe { llamacpp::sampler_init_top_p(req.top_p, req.min_keep) }; - let typical_p = unsafe { llamacpp::sampler_init_typical(req.typical_p, req.min_keep) }; - let temp = unsafe { llamacpp::sampler_init_temp(req.temp) }; + unsafe { + let top_k = llamacpp::sampler_init_top_k(req.top_k); + let top_p = llamacpp::sampler_init_top_p(req.top_p, req.min_keep); + let typical_p = llamacpp::sampler_init_typical(req.typical_p, req.min_keep); + let temp = llamacpp::sampler_init_temp(req.temp); + } let penalties = unsafe { llamacpp::sampler_init_penalties( req.penalty_last_n,