|
@ -76,8 +76,10 @@ async def generate_sync( |
|
|
reply = answer[:idx].strip() |
|
|
reply = answer[:idx].strip() |
|
|
else: |
|
|
else: |
|
|
reply = answer.removesuffix('<|endoftext|>').strip() |
|
|
reply = answer.removesuffix('<|endoftext|>').strip() |
|
|
reply = reply.replace("\n{bot.name}: ", " ") |
|
|
reply = reply.replace("\\n{bot.name}: ", " ") |
|
|
reply = reply.replace("\n<BOT>: ", " ") |
|
|
reply = reply.replace("\\n<BOT>: ", " ") |
|
|
|
|
|
reply = reply.replace("<BOT>", "{bot.name}") |
|
|
|
|
|
reply = reply.replace("<USER>", "You") |
|
|
return reply |
|
|
return reply |
|
|
else: |
|
|
else: |
|
|
err_msg = r_json["error"] if "error" in r_json else "" |
|
|
err_msg = r_json["error"] if "error" in r_json else "" |
|
|