f-string
This commit is contained in:
parent
d6fc61739f
commit
2eefb488d5
|
@ -5183,25 +5183,25 @@ def sendtocluster(txt, min, max):
|
||||||
)
|
)
|
||||||
js = req.json()
|
js = req.json()
|
||||||
except requests.exceptions.ConnectionError:
|
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))
|
print("{0}{1}{2}".format(colors.RED, errmsg, colors.END))
|
||||||
emit('from_server', {'cmd': 'errmsg', 'data': errmsg}, broadcast=True)
|
emit('from_server', {'cmd': 'errmsg', 'data': errmsg}, broadcast=True)
|
||||||
set_aibusy(0)
|
set_aibusy(0)
|
||||||
return
|
return
|
||||||
except requests.exceptions.JSONDecodeError:
|
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))
|
print("{0}{1}{2}".format(colors.RED, errmsg, colors.END))
|
||||||
emit('from_server', {'cmd': 'errmsg', 'data': errmsg}, broadcast=True)
|
emit('from_server', {'cmd': 'errmsg', 'data': errmsg}, broadcast=True)
|
||||||
set_aibusy(0)
|
set_aibusy(0)
|
||||||
return
|
return
|
||||||
if(req.status_code == 503):
|
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))
|
print("{0}{1}{2}".format(colors.RED, json.dumps(js, indent=2), colors.END))
|
||||||
emit('from_server', {'cmd': 'errmsg', 'data': errmsg}, broadcast=True)
|
emit('from_server', {'cmd': 'errmsg', 'data': errmsg}, broadcast=True)
|
||||||
set_aibusy(0)
|
set_aibusy(0)
|
||||||
return
|
return
|
||||||
if(req.status_code != 200):
|
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))
|
print("{0}{1}{2}".format(colors.RED, json.dumps(js, indent=2), colors.END))
|
||||||
emit('from_server', {'cmd': 'errmsg', 'data': errmsg}, broadcast=True)
|
emit('from_server', {'cmd': 'errmsg', 'data': errmsg}, broadcast=True)
|
||||||
set_aibusy(0)
|
set_aibusy(0)
|
||||||
|
|
Loading…
Reference in New Issue