From 0987efd00b4bcec71ce6a83f19a453c8c83f3132 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Fri, 14 Apr 2023 00:27:46 +0200 Subject: [PATCH] add another end token --- matrix_pygmalion_bot/ai/koboldcpp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matrix_pygmalion_bot/ai/koboldcpp.py b/matrix_pygmalion_bot/ai/koboldcpp.py index 54e7f1b..95d6d02 100644 --- a/matrix_pygmalion_bot/ai/koboldcpp.py +++ b/matrix_pygmalion_bot/ai/koboldcpp.py @@ -79,7 +79,7 @@ async def generate_sync( if not partial_reply or tokens >= max_new_tokens +100: # ToDo: is a hundred past the limit okay? complete = True break - for t in [f"\nYou:", f"\n### Human:", f"\n{bot.user_name}:", '<|endoftext|>']: + for t in [f"\nYou:", f"\n### Human:", f"\n{bot.user_name}:", '<|endoftext|>', '']: idx = complete_reply.find(t) if idx != -1: complete_reply = complete_reply[:idx].strip()