Fixed JSON decoding bug

This commit is contained in:
Jack
2025-03-24 13:54:05 +02:00
parent 71c45e1b41
commit b4a8668523
2 changed files with 6 additions and 6 deletions
+3 -5
View File
@@ -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:
+3 -1
View File
@@ -1 +1,3 @@
python-dotenv
python-dotenv
brotli
zstd