summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-05-19 17:45:57 +0200
committerGitHub <noreply@github.com>2024-05-19 17:45:57 +0200
commit370ac539433de93aae9656d29111f50224ec6d5b (patch)
treea81fc7a8d68e3ace268ef0c58d9594c90d6653dd
parentMerge pull request #1981 from hlohaus/leech (diff)
downloadgpt4free-370ac539433de93aae9656d29111f50224ec6d5b.tar
gpt4free-370ac539433de93aae9656d29111f50224ec6d5b.tar.gz
gpt4free-370ac539433de93aae9656d29111f50224ec6d5b.tar.bz2
gpt4free-370ac539433de93aae9656d29111f50224ec6d5b.tar.lz
gpt4free-370ac539433de93aae9656d29111f50224ec6d5b.tar.xz
gpt4free-370ac539433de93aae9656d29111f50224ec6d5b.tar.zst
gpt4free-370ac539433de93aae9656d29111f50224ec6d5b.zip
-rw-r--r--g4f/client/async_client.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/g4f/client/async_client.py b/g4f/client/async_client.py
index 1508e566..9849c565 100644
--- a/g4f/client/async_client.py
+++ b/g4f/client/async_client.py
@@ -183,9 +183,10 @@ async def iter_image_response(
return ImagesResponse([Image(None, image, chunk.alt) for image in chunk.get_list()], int(time.time()))
def create_image(provider: ProviderType, prompt: str, model: str = "", **kwargs) -> AsyncIterator:
- prompt = f"create a image with: {prompt}"
- if provider.__name__ == "You":
+ if isinstance(provider, type) and provider.__name__ == "You":
kwargs["chat_mode"] = "create"
+ else:
+ prompt = f"create a image with: {prompt}"
return provider.create_async_generator(
model,
[{"role": "user", "content": prompt}],