summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/needs_auth/DeepInfraImage.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-11-19 20:53:11 +0100
committerGitHub <noreply@github.com>2024-11-19 20:53:11 +0100
commitde4f374c5d01216cf62ba3594cff3762a1fd8159 (patch)
tree7dd083571e2396a627dfd468f21af8402cc39f2d /g4f/Provider/needs_auth/DeepInfraImage.py
parentMerge pull request #2382 from hlohaus/info (diff)
parentAdd --cookie-browsers argument to cli (diff)
downloadgpt4free-de4f374c5d01216cf62ba3594cff3762a1fd8159.tar
gpt4free-de4f374c5d01216cf62ba3594cff3762a1fd8159.tar.gz
gpt4free-de4f374c5d01216cf62ba3594cff3762a1fd8159.tar.bz2
gpt4free-de4f374c5d01216cf62ba3594cff3762a1fd8159.tar.lz
gpt4free-de4f374c5d01216cf62ba3594cff3762a1fd8159.tar.xz
gpt4free-de4f374c5d01216cf62ba3594cff3762a1fd8159.tar.zst
gpt4free-de4f374c5d01216cf62ba3594cff3762a1fd8159.zip
Diffstat (limited to 'g4f/Provider/needs_auth/DeepInfraImage.py')
-rw-r--r--g4f/Provider/needs_auth/DeepInfraImage.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/g4f/Provider/needs_auth/DeepInfraImage.py b/g4f/Provider/needs_auth/DeepInfraImage.py
index 2310c1c8..24df04e3 100644
--- a/g4f/Provider/needs_auth/DeepInfraImage.py
+++ b/g4f/Provider/needs_auth/DeepInfraImage.py
@@ -73,7 +73,7 @@ class DeepInfraImage(AsyncGeneratorProvider, ProviderModelMixin):
async with session.post(f"{api_base.rstrip('/')}/{model}", json=data) as response:
await raise_for_status(response)
data = await response.json()
- images = data["output"] if "output" in data else data["images"]
+ images = data.get("output", data.get("images"))
if not images:
raise RuntimeError(f"Response: {data}")
images = images[0] if len(images) == 1 else images