From c0966e2287fb1f9cf38093d9144d5df48d560c30 Mon Sep 17 00:00:00 2001 From: Yingda Chen Date: Mon, 2 Dec 2024 18:07:54 +0800 Subject: [PATCH] fix test --- modelscope/hub/utils/caching.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modelscope/hub/utils/caching.py b/modelscope/hub/utils/caching.py index b6653a4b..675d62a8 100644 --- a/modelscope/hub/utils/caching.py +++ b/modelscope/hub/utils/caching.py @@ -272,7 +272,8 @@ class ModelFileSystemCache(FileSystemCache): cached_key['Revision'].startswith(key['Revision']) or key['Revision'].startswith(cached_key['Revision'])): expected_hash = model_file_info[FILE_HASH] - if expected_hash is not None: + if expected_hash is not None and os.path.exists( + cache_file_path): cache_file_sha256 = compute_hash(cache_file_path) if expected_hash == cache_file_sha256: is_exists = True