[BugFix] When the value of "temperature" is 0, adjust it to 1e-06 (#4900)

* add default temperature value

* add unit test

* update

* update

* add unit test

* update

* fix unit test
This commit is contained in:
luukunn
2025-11-10 13:24:33 +08:00
committed by GitHub
parent 0a3bc84f71
commit 41c0bef964
3 changed files with 17 additions and 1 deletions

View File

@@ -252,6 +252,8 @@ class LLMEngine:
request.llm_engine_recv_req_timestamp = time.time()
llm_logger.info(f"Receive request {request}")
if sampling_params is not None:
if sampling_params.temperature is not None and abs(sampling_params.temperature) < 1e-06:
sampling_params.temperature = 1e-06
request.sampling_params = sampling_params
request.preprocess_start_time = time.time()
chat_template_kwargs = kwargs.get("chat_template_kwargs") or {}