From 3a99b2b030b991128570803d715c8ad85fcc3888 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Mon, 16 Jan 2023 13:53:30 -0300 Subject: [PATCH] Change a truncation parameter --- server.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server.py b/server.py index 936ae869..fabd3d93 100644 --- a/server.py +++ b/server.py @@ -232,12 +232,12 @@ elif args.chat or args.cai_chat: if check: reply = generate_reply(question, tokens, inference_settings, selected_model, eos_token='\n')[0] - idx = reply.rfind(question[-500:]) - reply = reply[idx+min(500, len(question)):].split('\n')[0].strip() + idx = reply.rfind(question[-1024:]) + reply = reply[idx+min(1024, len(question)):].split('\n')[0].strip() else: reply = generate_reply(question, tokens, inference_settings, selected_model)[0] - idx = reply.rfind(question[-500:]) - reply = reply[idx+min(500, len(question)):] + idx = reply.rfind(question[-1024:]) + reply = reply[idx+min(1024, len(question)):] idx = reply.find(f"\n{name1}:") if idx != -1: reply = reply[:idx]