Skip to content

Commit e9bccd0

Browse files
committed
fix: Orchestrator - Storage providers - HuggingFace - Fixed the exists method when used on directories
1 parent 2b93ef6 commit e9bccd0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cloud_pipelines_backend/storage_providers/huggingface_repo_storage.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,10 @@ def download_bytes(self, source_uri: HuggingFaceRepoUri) -> bytes:
134134
return pathlib.Path(cache_path).read_bytes()
135135

136136
def exists(self, uri: HuggingFaceRepoUri) -> bool:
137-
return self._client.file_exists(
138-
repo_type=uri.repo_type,
139-
repo_id=uri.repo_id,
140-
filename=uri.path,
137+
repo_objects = self._client.get_paths_info(
138+
repo_type=uri.repo_type, repo_id=uri.repo_id, paths=[uri.path]
141139
)
140+
return len(repo_objects) > 0
142141

143142
def calculate_data_hash(self, *, data: bytes) -> dict[str, str]:
144143
import hashlib

0 commit comments

Comments
 (0)