From 5d41390629a08288fe5055fc654c4b31242f9818 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Thu, 6 Apr 2023 23:50:43 +0200 Subject: [PATCH] keyword replacement --- matrix_pygmalion_bot/ai/runpod_pygmalion.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/matrix_pygmalion_bot/ai/runpod_pygmalion.py b/matrix_pygmalion_bot/ai/runpod_pygmalion.py index 0fd74cb..78ca0c7 100644 --- a/matrix_pygmalion_bot/ai/runpod_pygmalion.py +++ b/matrix_pygmalion_bot/ai/runpod_pygmalion.py @@ -76,8 +76,10 @@ async def generate_sync( reply = answer[:idx].strip() else: reply = answer.removesuffix('<|endoftext|>').strip() - reply = reply.replace("\n{bot.name}: ", " ") - reply = reply.replace("\n: ", " ") + reply = reply.replace("\\n{bot.name}: ", " ") + reply = reply.replace("\\n: ", " ") + reply = reply.replace("", "{bot.name}") + reply = reply.replace("", "You") return reply else: err_msg = r_json["error"] if "error" in r_json else ""