mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 12:24:53 +00:00
fix: simplify changes
This commit is contained in:
parent
4ea2a98d34
commit
a2c935d5fb
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user