mirror of
https://github.com/modelscope/modelscope.git
synced 2026-08-29 10:08:40 +02:00
style: yapf format legacy cache reuse helpers
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user