diff options
Diffstat (limited to 'g4f')
-rw-r--r-- | g4f/__init__.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/g4f/__init__.py b/g4f/__init__.py index 2b0e5b46..996acf6c 100644 --- a/g4f/__init__.py +++ b/g4f/__init__.py @@ -45,12 +45,13 @@ def get_model_and_provider(model : Union[Model, str], else: raise ProviderNotFoundError(f'Provider not found: {provider}') + if isinstance(model, str): + if model in ModelUtils.convert: + model = ModelUtils.convert[model] + if not provider: if isinstance(model, str): - if model in ModelUtils.convert: - model = ModelUtils.convert[model] - else: - raise ModelNotFoundError(f'Model not found: {model}') + raise ModelNotFoundError(f'Model not found: {model}') provider = model.best_provider if not provider: |