diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-03-16 18:22:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-16 18:22:26 +0100 |
commit | fb2061da48525edab9cd993205bb5e30c386aa1a (patch) | |
tree | 1e740bd6955dfd27b9a4d773df07234ed9e5c75e /g4f/__init__.py | |
parent | Merge pull request #1694 from ComRSMaster/main (diff) | |
parent | Add conversation support for Bing (diff) | |
download | gpt4free-fb2061da48525edab9cd993205bb5e30c386aa1a.tar gpt4free-fb2061da48525edab9cd993205bb5e30c386aa1a.tar.gz gpt4free-fb2061da48525edab9cd993205bb5e30c386aa1a.tar.bz2 gpt4free-fb2061da48525edab9cd993205bb5e30c386aa1a.tar.lz gpt4free-fb2061da48525edab9cd993205bb5e30c386aa1a.tar.xz gpt4free-fb2061da48525edab9cd993205bb5e30c386aa1a.tar.zst gpt4free-fb2061da48525edab9cd993205bb5e30c386aa1a.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/__init__.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/g4f/__init__.py b/g4f/__init__.py index 441225f1..dce116c4 100644 --- a/g4f/__init__.py +++ b/g4f/__init__.py @@ -69,11 +69,14 @@ def get_model_and_provider(model : Union[Model, str], if isinstance(model, Model): model = model.name - if ignored and isinstance(provider, BaseRetryProvider): - provider.providers = [p for p in provider.providers if p.__name__ not in ignored] - if not ignore_working and not provider.working: raise ProviderNotWorkingError(f'{provider.__name__} is not working') + + if not ignore_working and isinstance(provider, BaseRetryProvider): + provider.providers = [p for p in provider.providers if p.working] + + if ignored and isinstance(provider, BaseRetryProvider): + provider.providers = [p for p in provider.providers if p.__name__ not in ignored] if not ignore_stream and not provider.supports_stream and stream: raise StreamNotSupportedError(f'{provider.__name__} does not support "stream" argument') |