From 64dd030ae3efcae957566a111a2073b2f4f203bf Mon Sep 17 00:00:00 2001 From: City <125218114+city96@users.noreply.github.com> Date: Thu, 15 Feb 2024 18:34:42 +0100 Subject: [PATCH] Fix NaN not allowed in newer requests versions --- core/dispatch.py | 7 ++++++- requirements.txt | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 requirements.txt diff --git a/core/dispatch.py b/core/dispatch.py index bb3dbb3..b73dff3 100644 --- a/core/dispatch.py +++ b/core/dispatch.py @@ -130,6 +130,11 @@ def dispatch_to_remote(remote_url, prompt, job_id=f"{get_client_id()}-unknown", "job_id": job_id, } } - ar = requests.post(f"{remote_url}/prompt", json=data, timeout=4) + ar = requests.post( + f"{remote_url}/prompt", + data = json.dumps(data), + headers = {"Content-Type": "application/json"}, + timeout = 4, + ) ar.raise_for_status() return diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..70e33ba --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +requests>=2.28.2