[to #47783159]fix: simply snapshot_download log

Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/11908733
This commit is contained in:
mulin.lyh
2023-03-09 01:03:26 +08:00
committed by wenmeng.zwm
parent dc53c42cea
commit e7b9b1ca24
2 changed files with 4 additions and 4 deletions

View File

@@ -121,7 +121,7 @@ def model_file_download(
if model_file['Path'] == file_path:
if cache.exists(model_file):
logger.info(
logger.debug(
f'File {model_file["Name"]} already in cache, skip downloading!'
)
return cache.get_file_by_info(model_file)
@@ -209,7 +209,7 @@ def http_get_file(
tempfile.NamedTemporaryFile, mode='wb', dir=local_dir, delete=False)
get_headers = {} if headers is None else copy.deepcopy(headers)
with temp_file_manager() as temp_file:
logger.info('downloading %s to %s', url, temp_file.name)
logger.debug('downloading %s to %s', url, temp_file.name)
# retry sleep 0.5s, 1s, 2s, 4s
retry = Retry(
total=API_FILE_DOWNLOAD_RETRY_TIMES,
@@ -248,7 +248,7 @@ def http_get_file(
retry = retry.increment('GET', url, error=e)
retry.sleep()
logger.info('storing %s in cache at %s', url, local_dir)
logger.debug('storing %s in cache at %s', url, local_dir)
downloaded_length = os.path.getsize(temp_file.name)
if total != downloaded_length:
os.remove(temp_file.name)

View File

@@ -122,7 +122,7 @@ def snapshot_download(model_id: str,
# check model_file is exist in cache, if existed, skip download, otherwise download
if cache.exists(model_file):
file_name = os.path.basename(model_file['Name'])
logger.info(
logger.debug(
f'File {file_name} already in cache, skip downloading!'
)
continue