mirror of
https://github.com/qdrant/fastembed.git
synced 2026-07-23 11:20:51 -05:00
fix: check if model files exist before returning cached path (#624)
This commit is contained in:
@@ -413,7 +413,7 @@ class ModelManagement(Generic[T]):
|
||||
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 @@ class ModelManagement(Generic[T]):
|
||||
**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:
|
||||
|
||||
Reference in New Issue
Block a user