|
@ -88,13 +88,13 @@ 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(f"\n{bot_name}: ", " ") |
|
|
reply.replace("\n<BOT>: ", " ") |
|
|
reply.replace(f"\n<BOT>: ", " ") |
|
|
return reply |
|
|
return reply |
|
|
else: |
|
|
else: |
|
|
await asyncio.sleep(DELAY) |
|
|
await asyncio.sleep(DELAY) |
|
|
else: |
|
|
else: |
|
|
return "<ERROR> {status}" |
|
|
return f"<ERROR> {status}" |
|
|
|
|
|
|
|
|
async def get_full_prompt(simple_prompt: str, bot, chat_history): |
|
|
async def get_full_prompt(simple_prompt: str, bot, chat_history): |
|
|
|
|
|
|
|
@ -185,7 +185,7 @@ async def generate_image(input_prompt: str, negative_prompt: str, model: str, ap |
|
|
"nsfw": True, |
|
|
"nsfw": True, |
|
|
"trusted_workers": False, |
|
|
"trusted_workers": False, |
|
|
# "workers": [], |
|
|
# "workers": [], |
|
|
"models": ["{model}"] |
|
|
"models": [f"{model}"] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
logger.info(f"sending request to stablehorde.net") |
|
|
logger.info(f"sending request to stablehorde.net") |
|
|