Add top_p
This commit is contained in:
parent
7c4d5ca8cc
commit
831ac7ed3f
1 changed files with 2 additions and 2 deletions
|
@ -86,11 +86,11 @@ def generate_reply(question, max_new_tokens, do_sample, temperature, top_p, typi
|
||||||
|
|
||||||
if shared.is_RWKV:
|
if shared.is_RWKV:
|
||||||
if shared.args.no_stream:
|
if shared.args.no_stream:
|
||||||
reply = shared.model.generate(question, token_count=max_new_tokens, temperature=temperature)
|
reply = shared.model.generate(question, token_count=max_new_tokens, temperature=temperature, top_p=top_p)
|
||||||
yield formatted_outputs(reply, None)
|
yield formatted_outputs(reply, None)
|
||||||
else:
|
else:
|
||||||
for i in range(max_new_tokens//8):
|
for i in range(max_new_tokens//8):
|
||||||
reply = shared.model.generate(question, token_count=8, temperature=temperature)
|
reply = shared.model.generate(question, token_count=8, temperature=temperature, top_p=top_p)
|
||||||
yield formatted_outputs(reply, None)
|
yield formatted_outputs(reply, None)
|
||||||
question = reply
|
question = reply
|
||||||
return formatted_outputs(reply, None)
|
return formatted_outputs(reply, None)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue