fix the crash issue caused by temperature being 0

This commit is contained in:
josc146 2023-06-04 11:53:33 +08:00
parent 539c538d65
commit 4e75531651

View File

@ -204,7 +204,10 @@ def set_rwkv_config(model: RWKV, body: ModelConfigBody):
if body.max_tokens is not None: if body.max_tokens is not None:
model.max_tokens_per_generation = body.max_tokens model.max_tokens_per_generation = body.max_tokens
if body.temperature is not None: if body.temperature is not None:
model.temperature = body.temperature if body.temperature < 0.1:
model.temperature = 0.1
else:
model.temperature = body.temperature
if body.top_p is not None: if body.top_p is not None:
model.top_p = body.top_p model.top_p = body.top_p
if body.presence_penalty is not None: if body.presence_penalty is not None: