Skip to content

Commit

Permalink
misc: align PyTorch Engine temprature with TurboMind (#1850)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyncs authored Jun 26, 2024
1 parent a06174f commit 378c6d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lmdeploy/pytorch/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ def from_gen_config(self, gen_config: EngineGenerationConfig):
logger.warning('`top_p` has to be a float > 0 and < 1'
f' but is {top_p}')
top_p = 1.0
if temperature <= 0:
if temperature == 0:
logger.warning('`temperature` is 0, set to 1e-6')
temperature = 1e-6
if temperature < 0:
logger.warning('`temperature` has to be a strictly'
f' positive value, but is {temperature}')
temperature = 1.0
Expand Down

0 comments on commit 378c6d3

Please sign in to comment.