Spaces:
Running
Running
:zap: [Enhance] Set min and max for top_p
Browse files
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
|
88 |
temperature = max(temperature, 0.01)
|
89 |
-
temperature = min(temperature,
|
|
|
|
|
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]
|