From 8c91f63af5c8ed8cfd5ac3202d0c690991952bee Mon Sep 17 00:00:00 2001 From: Yingda Chen Date: Tue, 12 Nov 2024 12:15:29 +0800 Subject: [PATCH] fix log for downloading to local dir (#1080) Co-authored-by: Yingda Chen --- modelscope/hub/snapshot_download.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modelscope/hub/snapshot_download.py b/modelscope/hub/snapshot_download.py index dbec55c1..9d32a08e 100644 --- a/modelscope/hub/snapshot_download.py +++ b/modelscope/hub/snapshot_download.py @@ -221,7 +221,9 @@ def _snapshot_download( cookies = ModelScopeConfig.get_cookies() repo_files = [] if repo_type == REPO_TYPE_MODEL: - directory = os.path.join(system_cache, 'hub', repo_id) + directory = os.path.abspath( + local_dir) if local_dir is not None else os.path.join( + system_cache, 'hub', repo_id) print(f'Downloading Model to directory: {directory}') revision_detail = _api.get_valid_revision_detail( repo_id, revision=revision, cookies=cookies) @@ -274,7 +276,9 @@ def _snapshot_download( ) elif repo_type == REPO_TYPE_DATASET: - directory = os.path.join(system_cache, 'datasets', repo_id) + directory = os.path.abspath( + local_dir) if local_dir is not None else os.path.join( + system_cache, 'datasets', repo_id) print(f'Downloading Dataset to directory: {directory}') group_or_owner, name = model_id_to_group_owner_name(repo_id) if not revision: