diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-02-11 09:26:02 +0100 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-02-11 09:26:02 +0100 |
commit | 9aeae65b9b0e7322f63186c0df061de06ca642ee (patch) | |
tree | a2436c8874e24e95dbb9d821b6d461cc3d2f3100 /g4f/Provider/create_images.py | |
parent | Change python version to 3.12 in unitests (diff) | |
download | gpt4free-9aeae65b9b0e7322f63186c0df061de06ca642ee.tar gpt4free-9aeae65b9b0e7322f63186c0df061de06ca642ee.tar.gz gpt4free-9aeae65b9b0e7322f63186c0df061de06ca642ee.tar.bz2 gpt4free-9aeae65b9b0e7322f63186c0df061de06ca642ee.tar.lz gpt4free-9aeae65b9b0e7322f63186c0df061de06ca642ee.tar.xz gpt4free-9aeae65b9b0e7322f63186c0df061de06ca642ee.tar.zst gpt4free-9aeae65b9b0e7322f63186c0df061de06ca642ee.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/Provider/create_images.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/g4f/Provider/create_images.py b/g4f/Provider/create_images.py index b8bcbde3..9a9e3f08 100644 --- a/g4f/Provider/create_images.py +++ b/g4f/Provider/create_images.py @@ -87,7 +87,7 @@ class CreateImagesProvider(BaseProvider): messages.insert(0, {"role": "system", "content": self.system_message}) buffer = "" for chunk in self.provider.create_completion(model, messages, stream, **kwargs): - if buffer or "<" in chunk: + if isinstance(chunk, str) and buffer or "<" in chunk: buffer += chunk if ">" in buffer: match = re.search(r'<img data-prompt="(.*?)">', buffer) |