mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 12:24:53 +00:00
Lint.
This commit is contained in:
parent
7ecda467c2
commit
7d07e92d94
@ -1010,8 +1010,12 @@ async fn chat_completions(
|
|||||||
let tool_prompt = tool_prompt.unwrap_or_default();
|
let tool_prompt = tool_prompt.unwrap_or_default();
|
||||||
let stop = stop.unwrap_or_default();
|
let stop = stop.unwrap_or_default();
|
||||||
// enable greedy only when temperature is 0
|
// enable greedy only when temperature is 0
|
||||||
let do_sample = temperature.map_or(true, |t| t != 0.0);
|
let (do_sample, temperature) = match temperature{
|
||||||
let temperature = temperature.map(|t| if t == 0.0 { 1.0 } else { t });
|
Some(temperature) if temperature == 0.0 => {
|
||||||
|
(false, None)
|
||||||
|
}
|
||||||
|
other => (true, other)
|
||||||
|
};
|
||||||
|
|
||||||
// extract tool grammar if present
|
// extract tool grammar if present
|
||||||
let tool_grammar = match ToolGrammar::apply(tools, tool_choice) {
|
let tool_grammar = match ToolGrammar::apply(tools, tool_choice) {
|
||||||
|
Loading…
Reference in New Issue
Block a user