mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-25 17:29:22 +01:00
Add top_p
This commit is contained in:
parent
7c4d5ca8cc
commit
831ac7ed3f
@ -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…
Reference in New Issue
Block a user