diff --git a/modelscope/hub/utils/utils.py b/modelscope/hub/utils/utils.py index 7a8c43c4..7b7c042e 100644 --- a/modelscope/hub/utils/utils.py +++ b/modelscope/hub/utils/utils.py @@ -251,8 +251,8 @@ def find_reusable_legacy_repo_dir( ] for path in legacy_candidates: if _non_empty_dir(path): - logger.info( - 'Found legacy cache at %s for %s, reusing.', path, repo_id) + logger.info('Found legacy cache at %s for %s, reusing.', path, + repo_id) return str(path) return None diff --git a/tests/hub/test_legacy_cache_reuse.py b/tests/hub/test_legacy_cache_reuse.py index eb02e4f8..fc68276a 100644 --- a/tests/hub/test_legacy_cache_reuse.py +++ b/tests/hub/test_legacy_cache_reuse.py @@ -75,7 +75,8 @@ class LegacyCacheReuseTest(unittest.TestCase): def test_uses_modelscope_cache_env(self): legacy = self.cache / self.owner / self.name self._touch_model_dir(legacy) - with mock.patch.dict(os.environ, {'MODELSCOPE_CACHE': str(self.cache)}): + with mock.patch.dict(os.environ, + {'MODELSCOPE_CACHE': str(self.cache)}): found = find_reusable_legacy_repo_dir(self.model_id) self.assertEqual(found, str(legacy))