[Bugfix] Reject out-of-range temperature values in SamplingParams (#44965)

Signed-off-by: Peter Pan <Peter.Pan@daocloud.io>
This commit is contained in:
Peter Pan
2026-06-14 23:12:44 -07:00
committed by GitHub
parent 48df95c43e
commit ebb0a71ad0
+6
View File
@@ -526,6 +526,12 @@ class SamplingParams(
parameter="temperature",
value=self.temperature,
)
if self.temperature > 2.0:
raise VLLMValidationError(
f"temperature must be in [0, 2], got {self.temperature}.",
parameter="temperature",
value=self.temperature,
)
if not 0.0 < self.top_p <= 1.0:
raise VLLMValidationError(
f"top_p must be in (0, 1], got {self.top_p}.",