fix: simplify changes

This commit is contained in:
drbh 2024-04-17 14:11:16 +00:00
parent 4ea2a98d34
commit a2c935d5fb
2 changed files with 3 additions and 3 deletions

View File

@ -1009,9 +1009,9 @@ async fn chat_completions(
let logprobs = logprobs.unwrap_or(false);
let tool_prompt = tool_prompt.unwrap_or_default();
let stop = stop.unwrap_or_default();
// rescale temperature starting from 0.0 to 1.0
// chat temperature is zero-indexed instead of one-indexed; so we add 1.0 to the input or default to 1.0
let adjusted_temperature = temperature.map_or(1.0, |t| t + 1.0);
let do_sample = adjusted_temperature != 0.0;
let do_sample = adjusted_temperature != 1.0;
let temperature = Some(adjusted_temperature);
// extract tool grammar if present

View File

@ -217,7 +217,7 @@ impl Validation {
}
let temperature = temperature.unwrap_or(1.0);
if temperature < 0.0 {
if temperature <= 0.0 {
return Err(ValidationError::Temperature);
}