From 4db9b309803796bc5f996d0b3713344eb44207ec Mon Sep 17 00:00:00 2001 From: sigoden Date: Thu, 25 Apr 2024 10:15:54 +0800 Subject: refactor: rewrite list models of all clients (#436) --- src/client/ollama.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/client/ollama.rs') diff --git a/src/client/ollama.rs b/src/client/ollama.rs index 434e487..1394ced 100644 --- a/src/client/ollama.rs +++ b/src/client/ollama.rs @@ -179,15 +179,14 @@ fn build_body(data: SendData, model: &Model) -> Result { "options": {}, }); - if let Some(num_predict) = model.max_output_tokens { - body["options"]["num_predict"] = num_predict.into(); + if let Some(v) = model.max_output_tokens { + body["options"]["num_predict"] = v.into(); } - - if let Some(temperature) = temperature { - body["options"]["temperature"] = temperature.into(); + if let Some(v) = temperature { + body["options"]["temperature"] = v.into(); } - if let Some(top_p) = top_p { - body["options"]["top_p"] = top_p.into(); + if let Some(v) = top_p { + body["options"]["top_p"] = v.into(); } Ok(body) -- cgit v1.2.3