From 2eefb488d5aef36f1f7149d4db3c688ebdf378ee Mon Sep 17 00:00:00 2001 From: Divided by Zer0 Date: Sat, 10 Sep 2022 15:17:13 +0200 Subject: [PATCH] f-string --- aiserver.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aiserver.py b/aiserver.py index ab2f92a1..fc308f19 100644 --- a/aiserver.py +++ b/aiserver.py @@ -5183,25 +5183,25 @@ def sendtocluster(txt, min, max): ) js = req.json() except requests.exceptions.ConnectionError: - errmsg ="Horde unavailable. Please try again later" + errmsg = f"Horde unavailable. Please try again later" print("{0}{1}{2}".format(colors.RED, errmsg, colors.END)) emit('from_server', {'cmd': 'errmsg', 'data': errmsg}, broadcast=True) set_aibusy(0) return except requests.exceptions.JSONDecodeError: - errmsg ="Unexpected message received from the Horde: '{req.text}'" + errmsg = f"Unexpected message received from the Horde: '{req.text}'" print("{0}{1}{2}".format(colors.RED, errmsg, colors.END)) emit('from_server', {'cmd': 'errmsg', 'data': errmsg}, broadcast=True) set_aibusy(0) return if(req.status_code == 503): - errmsg = "KoboldAI API Error: No available KoboldAI servers found in Horde to fulfil this request using the selected models or other properties." + errmsg = f"KoboldAI API Error: No available KoboldAI servers found in Horde to fulfil this request using the selected models or other properties." print("{0}{1}{2}".format(colors.RED, json.dumps(js, indent=2), colors.END)) emit('from_server', {'cmd': 'errmsg', 'data': errmsg}, broadcast=True) set_aibusy(0) return if(req.status_code != 200): - errmsg = "KoboldAI API Error: Failed to get a standard reply from the Horde. Please check the console." + errmsg = f"KoboldAI API Error: Failed to get a standard reply from the Horde. Please check the console." print("{0}{1}{2}".format(colors.RED, json.dumps(js, indent=2), colors.END)) emit('from_server', {'cmd': 'errmsg', 'data': errmsg}, broadcast=True) set_aibusy(0)