Add repetition_penalty

This commit is contained in:
oobabooga 2023-03-31 19:01:34 -03:00
parent 2259143fec
commit 52065ae4cd
2 changed files with 2 additions and 2 deletions

View file

@ -130,7 +130,7 @@ def generate_reply(question, max_new_tokens, do_sample, temperature, top_p, typi
# RWKV has proper streaming, which is very nice.
# No need to generate 8 tokens at a time.
for reply in shared.model.generate_with_streaming(context=question, token_count=max_new_tokens, temperature=temperature, top_p=top_p, top_k=top_k):
for reply in shared.model.generate(context=question, token_count=max_new_tokens, temperature=temperature, top_p=top_p, top_k=top_k, repetition_penalty=repetition_penalty):
output = original_question+reply
if not (shared.args.chat or shared.args.cai_chat):
reply = original_question + apply_extensions(reply, "output")