Spaces:
Running
Running
:boom: [Fix] temperature must be strictly positive
Browse files42 unmodified lines434445464647484950515226 unmodified lines798081798082838485868742 unmodified lines line = line.decode("utf-8") line = re.sub(r"data:\s*", "", line) data = json.loads(line) try: content = data["token"]["text"] content = data["token"]["text"] except: logger.err(data) return content
def count_tokens(self, text):26 unmodified lines
if temperature is None or temperature < 0: temperature = 0.0 # temperature must be positive for HF LLM models temperature = min(temperature, 0.01) # temperature must be positive and <= 1 for HF LLM models temperature = max(temperature, 0.01) temperature = min(temperature, 1)
token_limit = ( self.TOKEN_LIMIT_MAP[self.model]networks/message_streamer.py+7-3