From 8e9bbb1379b41bc145597f87d7b3ab59e41dabb6 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Tue, 4 Apr 2023 01:49:47 +0200 Subject: [PATCH] fix name replacements --- matrix_pygmalion_bot/ai/runpod_pygmalion.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/matrix_pygmalion_bot/ai/runpod_pygmalion.py b/matrix_pygmalion_bot/ai/runpod_pygmalion.py index 3e0db14..8883b62 100644 --- a/matrix_pygmalion_bot/ai/runpod_pygmalion.py +++ b/matrix_pygmalion_bot/ai/runpod_pygmalion.py @@ -56,8 +56,8 @@ async def generate_sync( reply = answer[:idx].strip() else: reply = answer.removesuffix('<|endoftext|>').strip() - reply.replace("\n{bot_name}: ", " ") - reply.replace("\n: ", " ") + reply = reply.replace("\n{bot_name}: ", " ") + reply = reply.replace("\n: ", " ") return reply elif status == 'IN_PROGRESS' or status == 'IN_QUEUE': job_id = r_json["id"] @@ -84,7 +84,7 @@ async def generate_sync( else: reply = answer.removesuffix('<|endoftext|>').strip() reply = reply.replace("\n{bot_name}: ", " ") - reply.replace("\n: ", " ") + reply = reply.replace("\n: ", " ") return reply else: return ""