Skip to content

fix(download): expand user tilde in download-hf-snapshot.py - #5559

Open
vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/download-hf-snapshot-expand-tilde
Open

vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/download-hf-snapshot-expand-tilde

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Why this matters

In ods/scripts/download-hf-snapshot.py, the CLI argument cache_dir was typed as Path without expanding user tildes. Supplying a path such as ~/models caused cache_dir.mkdir() to create a literal ~ directory in the current working directory.

Call .expanduser().resolve() on cache_dir prior to directory creation, matching path resolution standards across ODS download scripts.

Validation

  • Baseline reproduction: passing unexpanded tilde path creates a literal directory named ~ in the repository root.
  • Post-fix: test_download_hf_snapshot_user_tilde.py confirms cache_dir expands user paths without creating a literal ~ folder.
  • Snapshot downloader suites: 1 passed. Ruff and diff checks pass; regression wired into Linux CI.

Overlap check

Searched live open/closed PRs by download-hf-snapshot.py. #5402 handles offline backend checks; this hardens cache directory argument parsing.

Risk / AI disclosure

AI-assisted investigation, implementation and CLI regressions. This strengthens CLI path resolution. Independent review remains a gate.

Follow-up integration evidence

Composed with #5402 at 3c186f3 without conflicts. Snapshot downloading checks remain intact.
Backlog composition was local-only (production/test diffs, excluding workflow/Makefile wiring); it is not an upstream merge or independent human approval. Declared live-review gates remain open.

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.

1 participant