Browse Source

keyword replacement

master
Hendrik Langer 2 years ago
parent
commit
5d41390629
  1. 6
      matrix_pygmalion_bot/ai/runpod_pygmalion.py

6
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<BOT>: ", " ")
reply = reply.replace("\\n{bot.name}: ", " ")
reply = reply.replace("\\n<BOT>: ", " ")
reply = reply.replace("<BOT>", "{bot.name}")
reply = reply.replace("<USER>", "You")
return reply
else:
err_msg = r_json["error"] if "error" in r_json else ""

Loading…
Cancel
Save