Skip to content

fix(utils): avoid mutating caller ignore patterns - #10001

Merged
tastelikefeet merged 1 commit into
modelscope:mainfrom
gry67673905:codex/fix-ignore-pattern-mutation
Sep 3, 2026
Merged

fix(utils): avoid mutating caller ignore patterns#10001
tastelikefeet merged 1 commit into
modelscope:mainfrom
gry67673905:codex/fix-ignore-pattern-mutation

Conversation

@gry67673905

Copy link
Copy Markdown
Contributor

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

safe_snapshot_download(..., download_model=False) appended weight-file exclusions to a caller-owned ignore_patterns list. Reusing that list for a subsequent full download could therefore still exclude .bin and .safetensors weights.

Copy the list when adding metadata-only exclusions so the caller's patterns remain unchanged. The regression test covers a metadata-only download followed by a full download using the same list.

Experiment results

  • .venv/bin/python -m unittest tests.utils.test_hub_utils
  • .venv/bin/pre-commit run --all-files

@tastelikefeet
tastelikefeet merged commit 39f4584 into modelscope:main Sep 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants