diff --git a/matrix_pygmalion_bot/ai/runpod_pygmalion.py b/matrix_pygmalion_bot/ai/runpod_pygmalion.py index 78ca0c7..e2cb9e7 100644 --- a/matrix_pygmalion_bot/ai/runpod_pygmalion.py +++ b/matrix_pygmalion_bot/ai/runpod_pygmalion.py @@ -76,10 +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: ", " ") - reply = reply.replace("", "{bot.name}") - reply = reply.replace("", "You") + reply = reply.replace(f"\n{bot.name}: ", " ") + reply = reply.replace(f"\n: ", " ") + reply = reply.replace(f"", "{bot.name}") + reply = reply.replace(f"", "You") return reply else: err_msg = r_json["error"] if "error" in r_json else "" diff --git a/matrix_pygmalion_bot/ai/stablehorde.py b/matrix_pygmalion_bot/ai/stablehorde.py index 7008de3..702ffa7 100644 --- a/matrix_pygmalion_bot/ai/stablehorde.py +++ b/matrix_pygmalion_bot/ai/stablehorde.py @@ -88,13 +88,13 @@ async def generate_sync( reply = answer[:idx].strip() else: reply = answer.removesuffix('<|endoftext|>').strip() - reply = reply.replace("\n{bot_name}: ", " ") - reply.replace("\n: ", " ") + reply = reply.replace(f"\n{bot_name}: ", " ") + reply.replace(f"\n: ", " ") return reply else: await asyncio.sleep(DELAY) else: - return " {status}" + return f" {status}" 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, "trusted_workers": False, # "workers": [], - "models": ["{model}"] + "models": [f"{model}"] } logger.info(f"sending request to stablehorde.net") diff --git a/runpod/runpod-worker-transformers/model_fetcher.py b/runpod/runpod-worker-transformers/model_fetcher.py index 7a79017..28f3086 100644 --- a/runpod/runpod-worker-transformers/model_fetcher.py +++ b/runpod/runpod-worker-transformers/model_fetcher.py @@ -80,8 +80,8 @@ def download_model(model_name): #https://huggingface.co/yahma/RWKV-14b_quant/resolve/main/RWKV-4-Pile-14B-20230213-8019.pqth if snapshot_path: - print("model downloaded to \"{snapshot_path}\"") - os.system("ln -s \"{snapshot_path}\" /workdir/model") + print(f"model downloaded to \"{snapshot_path}\"") + os.system(f"ln -s \"{snapshot_path}\" /workdir/model") # ---------------------------------------------------------------------------- # # Parse Arguments #