diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-11-20 02:35:35 +0100 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-11-20 02:35:35 +0100 |
commit | 5e9e56ed5388250237479ee59acdbc1c7017ea39 (patch) | |
tree | 027ebe8efcb413b648101ac6fd4fe744803e8a8a | |
parent | Add Cerebras and HuggingFace2 provider, Fix RubiksAI provider (diff) | |
download | gpt4free-5e9e56ed5388250237479ee59acdbc1c7017ea39.tar gpt4free-5e9e56ed5388250237479ee59acdbc1c7017ea39.tar.gz gpt4free-5e9e56ed5388250237479ee59acdbc1c7017ea39.tar.bz2 gpt4free-5e9e56ed5388250237479ee59acdbc1c7017ea39.tar.lz gpt4free-5e9e56ed5388250237479ee59acdbc1c7017ea39.tar.xz gpt4free-5e9e56ed5388250237479ee59acdbc1c7017ea39.tar.zst gpt4free-5e9e56ed5388250237479ee59acdbc1c7017ea39.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/client/__init__.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/g4f/client/__init__.py b/g4f/client/__init__.py index 1f3cdab1..549a244b 100644 --- a/g4f/client/__init__.py +++ b/g4f/client/__init__.py @@ -12,7 +12,7 @@ from typing import Union, AsyncIterator, Iterator, Coroutine from ..providers.base_provider import AsyncGeneratorProvider from ..image import ImageResponse, to_image, to_data_uri, is_accepted_format, EXTENSIONS_MAP -from ..typing import Messages, Cookies, Image +from ..typing import Messages, Image from ..providers.types import ProviderType, FinishReason, BaseConversation from ..errors import NoImageResponseError from ..providers.retry_provider import IterListProvider @@ -254,6 +254,8 @@ class Images: provider_handler = self.models.get(model, provider or self.provider or BingCreateImages) elif isinstance(provider, str): provider_handler = convert_to_provider(provider) + else: + provider_handler = provider if provider_handler is None: raise ValueError(f"Unknown model: {model}") if proxy is None: |