This commit is contained in:
tastelikefeet
2025-01-02 17:06:24 +08:00
committed by GitHub
parent a89bb73995
commit d257fdeac6

View File

@@ -9,7 +9,8 @@ from pathlib import Path
from typing import Dict, List, Optional, Union
from modelscope.hub.api import HubApi, ModelScopeConfig
from modelscope.hub.constants import MODELSCOPE_SHOW_INDIVIDUAL_PROGRESS_THRESHOLD
from modelscope.hub.constants import \
MODELSCOPE_SHOW_INDIVIDUAL_PROGRESS_THRESHOLD
from modelscope.hub.errors import InvalidParameter
from modelscope.hub.file_download import (create_temporary_directory_and_cache,
download_file, get_file_download_url)
@@ -480,6 +481,9 @@ def _download_file_lists(
raise InvalidParameter(
f'Invalid repo type: {repo_type}, supported types: {REPO_TYPE_SUPPORT}'
)
disable_tqdm = len(
filtered_repo_files
) > MODELSCOPE_SHOW_INDIVIDUAL_PROGRESS_THRESHOLD # noqa
download_file(
url,
repo_file,
@@ -487,8 +491,7 @@ def _download_file_lists(
cache,
headers,
cookies,
disable_tqdm=len(filtered_repo_files) >
MODELSCOPE_SHOW_INDIVIDUAL_PROGRESS_THRESHOLD,
disable_tqdm=disable_tqdm,
)
if len(filtered_repo_files) > 0: