fix: revise temp scaling logic

This commit is contained in:
drbh 2024-04-15 20:13:40 +00:00
parent a3874e9354
commit 7c8b473d58
1 changed files with 3 additions and 3 deletions

View File

@ -767,9 +767,9 @@ async fn chat_completions(
let seed = req.seed;
let stop = req.stop.unwrap_or_default();
// rescale where 0 is deterministic and 1 is random (this is the opposite of other endpoints)
let adjusted_temperature = req.temperature.map_or(1.0, |t| 1.0 - t);
let do_sample = adjusted_temperature > 0.0;
// rescale temperature starting from 0.0 to 1.0
let adjusted_temperature = req.temperature.map_or(1.0, |t| t + 1.0);
let do_sample = adjusted_temperature != 1.0;
let temperature = Some(adjusted_temperature);
// apply chat template to flatten the request into a single input