|
@ -95,11 +95,10 @@ async def generate_sync( |
|
|
|
|
|
|
|
|
if complete_reply: |
|
|
if complete_reply: |
|
|
complete_reply = complete_reply.removesuffix('<|endoftext|>') |
|
|
complete_reply = complete_reply.removesuffix('<|endoftext|>') |
|
|
complete_reply = complete_reply.replace(f"\n{bot.name}: ", " ") |
|
|
|
|
|
complete_reply = complete_reply.replace(f"\n<BOT>: ", " ") |
|
|
|
|
|
complete_reply = complete_reply.replace(f"<BOT>", f"{bot.name}") |
|
|
complete_reply = complete_reply.replace(f"<BOT>", f"{bot.name}") |
|
|
complete_reply = complete_reply.replace(f"<USER>", f"You") |
|
|
complete_reply = complete_reply.replace(f"<USER>", f"You") |
|
|
complete_reply = complete_reply.replace(f"### Assistant", f"{bot.name}") |
|
|
complete_reply = complete_reply.replace(f"### Assistant", f"{bot.name}") |
|
|
|
|
|
complete_reply = complete_reply.replace(f"\n{bot.name}: ", " ") |
|
|
return complete_reply.strip() |
|
|
return complete_reply.strip() |
|
|
else: |
|
|
else: |
|
|
raise ValueError(f"<ERROR> Timeout") |
|
|
raise ValueError(f"<ERROR> Timeout") |
|
|