diff --git a/fastembed/common/model_management.py b/fastembed/common/model_management.py index bfcf27cec..854f76b75 100644 --- a/fastembed/common/model_management.py +++ b/fastembed/common/model_management.py @@ -413,7 +413,7 @@ def download_model(cls, model: T, cache_dir: str, retries: int = 3, **kwargs: An try: cache_kwargs = deepcopy(kwargs) cache_kwargs["local_files_only"] = True - return Path( + resolved_path = Path( cls.download_files_from_huggingface( hf_source, cache_dir=cache_dir, @@ -421,6 +421,10 @@ def download_model(cls, model: T, cache_dir: str, retries: int = 3, **kwargs: An **cache_kwargs, ) ) + if (resolved_path / model.model_file).exists() and all( + (resolved_path / file).exists() for file in extra_patterns + ): + return resolved_path except Exception: pass finally: