Repository navigation
Enhance
- Requires
modelscope-hub>=0.7.0. - New
modelscope.utils.file_utils.get_hub_cache_root();modelscope.hub.cache_managerre-exportsget_cache_rootandresolve_cached_snapshot.MS_CACHE_HOMEis normalised to an absolute path when bridged into the hub config.
Fix
model_file_download(..., local_files_only=True)no longer calls the API to resolve the default revision, so offline downloads from cache work without network access or credentials.ms clear-cachelists every resolved target before deleting and delegates to modelscope-hub's scoped cache APIs; cache deletion viaFileSystemCachegoes through the same validated removal, refusing empty identifiers, path traversal, out-of-root targets and symlinked paths.update_local_modelno longer copies models that already live under the legacy model root or the modelscope-hub cache root.- Hugging Face patch:
hf_hub_downloadtranslates missing files toEntryNotFoundErrorand cache misses toLocalEntryNotFoundError, so callers relying on Hugging Face exception types keep working. modelscope.hub.snapshot_downloadexportsInvalidParameteragain, preserving the shim module's exception contract.
Docs
- Docstrings for the legacy cache-path helpers now state that they describe the legacy layout only and point to
get_hub_cache_root(),snapshot_download()andresolve_cached_snapshot().
What's Changed
- Offline Download & Cache Cleanup Fixes by @wangxingjun778 in #1844
Full Changelog: v1.40.2...v1.40.3