From 04b1c1f94fc0fe5fac743ffa6c5b4f79da4a30a2 Mon Sep 17 00:00:00 2001 From: Kaustubh Maske Patil <37668193+nikochiko@users.noreply.github.com> Date: Fri, 6 Dec 2024 13:44:42 +0530 Subject: [PATCH] bugfix: allow sending temperature=0 values with a stricter `if temperature is None` comparison when falling back to NOT_GIVEN --- daras_ai_v2/language_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daras_ai_v2/language_model.py b/daras_ai_v2/language_model.py index 68d642c21..f01adde57 100644 --- a/daras_ai_v2/language_model.py +++ b/daras_ai_v2/language_model.py @@ -1052,7 +1052,7 @@ def _run_openai_chat( max_completion_tokens=max_completion_tokens, stop=stop or NOT_GIVEN, n=num_outputs, - temperature=temperature or NOT_GIVEN, + temperature=temperature if temperature is not None else NOT_GIVEN, frequency_penalty=frequency_penalty, presence_penalty=presence_penalty, tools=[tool.spec for tool in tools] if tools else NOT_GIVEN,