mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-25 12:39:25 +01:00
add log for download location (#1061)
Co-authored-by: Yingda Chen <yingda.chen@alibaba-inc.com>
This commit is contained in:
@@ -193,7 +193,9 @@ def _snapshot_download(
|
||||
|
||||
temporary_cache_dir, cache = create_temporary_directory_and_cache(
|
||||
repo_id, local_dir=local_dir, cache_dir=cache_dir, repo_type=repo_type)
|
||||
|
||||
system_cache = cache_dir if cache_dir is not None else os.getenv(
|
||||
'MODELSCOPE_CACHE',
|
||||
Path.home().joinpath('.cache', 'modelscope'))
|
||||
if local_files_only:
|
||||
if len(cache.cached_files) == 0:
|
||||
raise ValueError(
|
||||
@@ -217,6 +219,8 @@ def _snapshot_download(
|
||||
if cookies is None:
|
||||
cookies = ModelScopeConfig.get_cookies()
|
||||
repo_files = []
|
||||
directory = os.path.join(system_cache, 'hub', repo_id)
|
||||
print(f'Downloading Model to directory: {directory}')
|
||||
if repo_type == REPO_TYPE_MODEL:
|
||||
revision_detail = _api.get_valid_revision_detail(
|
||||
repo_id, revision=revision, cookies=cookies)
|
||||
@@ -257,6 +261,8 @@ def _snapshot_download(
|
||||
allow_patterns=allow_patterns)
|
||||
|
||||
elif repo_type == REPO_TYPE_DATASET:
|
||||
directory = 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:
|
||||
revision = DEFAULT_DATASET_REVISION
|
||||
|
||||
Reference in New Issue
Block a user