diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-01-13 15:48:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-13 15:48:38 +0100 |
commit | 467f2a6fc67e6c5a6cf996da961dc1f68bd7d456 (patch) | |
tree | 70d06c98503a235d8e6727a9ea4537fea4330f8c /g4f/Provider/create_images.py | |
parent | ~ (diff) | |
parent | Support upload image in gui (diff) | |
download | gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.tar gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.tar.gz gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.tar.bz2 gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.tar.lz gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.tar.xz gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.tar.zst gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.zip |
Diffstat (limited to 'g4f/Provider/create_images.py')
-rw-r--r-- | g4f/Provider/create_images.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/g4f/Provider/create_images.py b/g4f/Provider/create_images.py index 29f88a80..f8a0442d 100644 --- a/g4f/Provider/create_images.py +++ b/g4f/Provider/create_images.py @@ -2,6 +2,7 @@ from __future__ import annotations import re import asyncio +from .. import debug from ..typing import CreateResult, Messages from ..base_provider import BaseProvider, ProviderType @@ -26,12 +27,11 @@ class CreateImagesProvider(BaseProvider): self.create_images = create_images self.create_images_async = create_async self.system_message = system_message + self.include_placeholder = include_placeholder self.__name__ = provider.__name__ + self.url = provider.url self.working = provider.working self.supports_stream = provider.supports_stream - self.include_placeholder = include_placeholder - if hasattr(provider, "url"): - self.url = provider.url def create_completion( self, @@ -54,6 +54,8 @@ class CreateImagesProvider(BaseProvider): yield start if self.include_placeholder: yield placeholder + if debug.logging: + print(f"Create images with prompt: {prompt}") yield from self.create_images(prompt) if append: yield append @@ -76,6 +78,8 @@ class CreateImagesProvider(BaseProvider): placeholders = [] for placeholder, prompt in matches: if placeholder not in placeholders: + if debug.logging: + print(f"Create images with prompt: {prompt}") results.append(self.create_images_async(prompt)) placeholders.append(placeholder) results = await asyncio.gather(*results) |