From 831ac7ed3f8829b65e9e7f7c6ef76e5662faad43 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Wed, 1 Mar 2023 16:45:48 -0300 Subject: [PATCH] Add top_p --- modules/text_generation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/text_generation.py b/modules/text_generation.py index cc8b62d4..1324c8b8 100644 --- a/modules/text_generation.py +++ b/modules/text_generation.py @@ -86,11 +86,11 @@ def generate_reply(question, max_new_tokens, do_sample, temperature, top_p, typi if shared.is_RWKV: 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) else: 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) question = reply return formatted_outputs(reply, None)