Skip to content

Commit ee37a16

Browse files
committed
fix: Storage Providers - HuggingFace - Fixed bug when uploading and downloading non-directory artifacts
The bug caused directory upload/download methods to always be used, even when uploading/downloading a single file.
1 parent 4b8af7e commit ee37a16

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cloud_pipelines_backend/storage_providers/huggingface_repo_storage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def parse_uri_get_accessor(self, uri_string: str) -> interfaces.UriAccessor:
8989

9090
def upload(self, source_path: str, destination_uri: HuggingFaceRepoUri):
9191
_LOGGER.debug(f"Uploading from {source_path} to {destination_uri}")
92-
if pathlib.Path(source_path).is_dir:
92+
if pathlib.Path(source_path).is_dir():
9393
self._client.upload_folder(
9494
repo_type=destination_uri.repo_type,
9595
repo_id=destination_uri.repo_id,
@@ -119,7 +119,7 @@ def download(self, source_uri: HuggingFaceRepoUri, destination_path: str):
119119
)
120120
import shutil
121121

122-
if cache_data_path.is_dir:
122+
if cache_data_path.is_dir():
123123
shutil.copytree(cache_data_path, destination_path, dirs_exist_ok=True)
124124
else:
125125
pathlib.Path(destination_path).parent.mkdir(parents=True, exist_ok=True)

0 commit comments

Comments
 (0)