From b4a866852335207b780f84838927d82dface75a2 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 24 Mar 2025 13:54:05 +0200 Subject: [PATCH] Fixed JSON decoding bug --- modules/utils/runwareUtils.py | 8 +++----- requirements.txt | 4 +++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/utils/runwareUtils.py b/modules/utils/runwareUtils.py index 0dd5b2d..a3bfb22 100644 --- a/modules/utils/runwareUtils.py +++ b/modules/utils/runwareUtils.py @@ -254,9 +254,8 @@ def inferenecRequest(genConfig): } try: - def recaller(): - response = session.post( + return session.post( RUNWARE_API_BASE_URL, headers=headers, json=genConfig, @@ -264,15 +263,14 @@ def inferenecRequest(genConfig): allow_redirects=False, stream=True, ) - if response.status_code != 200: - print(f"[Debugging] Runware Response Status Code: {response.status_code}") - return response genResult = generalRequestWrapper(recaller) try: genResult = genResult.json() except json.JSONDecodeError as e: print(f"[Debugging] Runware JSON Decode Error: {str(e)}") + print(f"[Debugging] Runware Response Status Code: {genResult.status_code}") + print(f"[Debugging] Runware Response Headers: {genResult.headers}") print(f"[Debugging] Runware Raw Response Content: {genResult.content}") raise Exception("Error: Invalid JSON response from API!") if "errors" in genResult: diff --git a/requirements.txt b/requirements.txt index 3e338bf..0fc4ba4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,3 @@ -python-dotenv \ No newline at end of file +python-dotenv +brotli +zstd \ No newline at end of file