From 010a15a94ecb5c03076710adac5687dd49312434 Mon Sep 17 00:00:00 2001 From: yaozhewei Date: Sat, 29 Apr 2023 02:05:59 +0500 Subject: [PATCH 1/2] . --- applications/DeepSpeed-Chat/inference/chatbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/DeepSpeed-Chat/inference/chatbot.py b/applications/DeepSpeed-Chat/inference/chatbot.py index bd6b71132..e3997eb83 100644 --- a/applications/DeepSpeed-Chat/inference/chatbot.py +++ b/applications/DeepSpeed-Chat/inference/chatbot.py @@ -59,7 +59,7 @@ def get_model_response(generator, user_input, max_new_tokens): def process_response(response, num_rounds): output = str(response[0]["generated_text"]) - output = output.replace("<|endoftext|>", "") + output = output.replace("<|endoftext|>", "") all_positions = [m.start() for m in re.finditer("Human: ", output)] place_of_second_q = -1 if len(all_positions) > num_rounds: From 5cbe4e37784ffa75ff7c71c327c173ddb7505f59 Mon Sep 17 00:00:00 2001 From: Zhewei Yao Date: Fri, 28 Apr 2023 14:15:42 -0700 Subject: [PATCH 2/2] Update chatbot.py add more criterion. --- applications/DeepSpeed-Chat/inference/chatbot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/applications/DeepSpeed-Chat/inference/chatbot.py b/applications/DeepSpeed-Chat/inference/chatbot.py index e3997eb83..308ba3393 100644 --- a/applications/DeepSpeed-Chat/inference/chatbot.py +++ b/applications/DeepSpeed-Chat/inference/chatbot.py @@ -59,6 +59,7 @@ def get_model_response(generator, user_input, max_new_tokens): def process_response(response, num_rounds): output = str(response[0]["generated_text"]) + output = output.replace("<|endoftext|>", "") output = output.replace("<|endoftext|>", "") all_positions = [m.start() for m in re.finditer("Human: ", output)] place_of_second_q = -1