Hansimov commited on
Commit
64645f0
1 Parent(s): 403b8cf

:zap: [Enhance] Set min and max for top_p

Browse files
Files changed (1) hide show
  1. networks/message_streamer.py +4 -2
networks/message_streamer.py CHANGED
@@ -84,9 +84,11 @@ class MessageStreamer:
84
 
85
  if temperature is None or temperature < 0:
86
  temperature = 0.0
87
- # temperature must be positive and <= 1 for HF LLM models
88
  temperature = max(temperature, 0.01)
89
- temperature = min(temperature, 1)
 
 
90
 
91
  token_limit = int(
92
  self.TOKEN_LIMIT_MAP[self.model]
 
84
 
85
  if temperature is None or temperature < 0:
86
  temperature = 0.0
87
+ # temperature must 0 < and < 1 for HF LLM models
88
  temperature = max(temperature, 0.01)
89
+ temperature = min(temperature, 0.99)
90
+ top_p = max(top_p, 0.01)
91
+ top_p = min(top_p, 0.99)
92
 
93
  token_limit = int(
94
  self.TOKEN_LIMIT_MAP[self.model]