From a3fab75d5482c1111e15dcfe84a9af3f5568392e Mon Sep 17 00:00:00 2001 From: randaller Date: Mon, 20 Mar 2023 17:45:34 +0300 Subject: [PATCH] Update hf-chat-example.py --- hf-chat-example.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hf-chat-example.py b/hf-chat-example.py index d0bae72..997afec 100644 --- a/hf-chat-example.py +++ b/hf-chat-example.py @@ -25,7 +25,8 @@ AI: Hello! How can I assist you today? """ while True: - print(ctx) + print('-' * 40) + print(ctx.rstrip("\n")) prompt = input(f'User: ') if ctx != "": ctx = ctx + "User: " + prompt + "\n" @@ -42,6 +43,7 @@ while True: max_length=2048, top_p=0.95, temperature=1.0, + repetition_penalty=1.17, eos_token_id=n ) decoded = tokenizer.decode(result[0])