Skip to content

v0.7.0

Choose a tag to compare

@wangxingjun778 wangxingjun778 released this 09 Nov 09:23
· 3 commits to release/0.7 since this release
6824307

Feature

  • New modelscope_hub.kernels package: load optimized compute kernels from ModelScope mirrors — get_kernel, get_kernel_variants, has_kernel, get_local_kernel, install_kernel, install_kernel_all_variants, get_locked_kernel, load_kernel, and patch_kernels_hub. Only the kernels Hub API factory is swapped per call, so a plain import kernels keeps using the Hugging Face Hub. Install with pip install "modelscope-hub[kernels]" (kernels>=0.17).
  • Kernel publishers are allowlisted (kernels-community by default, extendable with MS_KERNELS_TRUSTED_PUBLISHERS); mirrors that only carry master resolve as kernel version v1; a cross-hub lockfile commit hash fails with an actionable note instead of a silent mismatch.
  • New public cache helpers get_cache_root() and resolve_cached_snapshot(); MS_CACHE_HOME is accepted as a legacy alias for the cache root.
  • ms-hub cache clear --dry-run lists the targets that would be deleted.

Enhance

  • local_files_only=True in the compatibility snapshot_download / model_file_download / dataset_file_download resolves purely from the local cache: no network access, no credential initialisation, no directory creation, and CacheNotFound when absent. Report/recovery options are rejected when combined with local_files_only.
  • Legacy-compatible snapshot_download() keeps <legacy model root>/<owner>/<name> linked to the directory it returns, so callers that still append a repository ID to the old root (e.g. released vLLM builds) keep working. The link is created only inside the active cache root, is skipped for offline resolution, replaces only its own links, and is skipped when symlinks are unsupported.

Fix

  • Cached snapshots are reused instead of re-downloaded, and the legacy path link is treated as an alias by legacy-cache detection, scanning and cleanup rather than as a separate legacy repository.
  • cache clear now validates every target before deleting anything: unsafe roots (filesystem root, home and its ancestors), empty identifiers, path traversal, out-of-root targets, symlinked containers or parents, and cache-type containers are rejected for the whole batch; only typed repository directories are removed.

Refactor

  • vLLM compatibility is delivered by the legacy cache-path link instead of an in-memory adapter: modelscope-hub does not import or patch vLLM and declares no dependency on huggingface_hub; Hugging Face semantics stay in modelscope.utils.hf_util.
  • HubConfig expands ~ in cache_dir / config_dir on construction, and cache-clear target planning is shared between the SDK and the CLI (--dry-run uses the same resolution).

Docs

  • README: kernel usage and constraints, cache-root/snapshot resolution guidance, cache clear --dry-run.
  • AGENTS.md: new vLLM compatibility contract covering cache paths, argument/exception propagation, offline behaviour and regression expectations.

What's Changed

Full Changelog: v0.6.1...v0.7.0