Skip to content

Replace deprecated huggingface-cli with hf - #607

Open
Ben Younes (ousamabenyounes) wants to merge 1 commit into
microsoft:mainfrom
ousamabenyounes:fix/issue-560
Open

Replace deprecated huggingface-cli with hf#607
Ben Younes (ousamabenyounes) wants to merge 1 commit into
microsoft:mainfrom
ousamabenyounes:fix/issue-560

Conversation

@ousamabenyounes

Copy link
Copy Markdown

Summary

huggingface-cli was removed from recent huggingface_hub releases; the current CLI entry point is hf. setup_env.py still shells out to huggingface-cli download for the -hr/--hf-repo flow, so that documented path now fails with command not found.

This migrates every non-submodule reference to the current hf CLI:

  • setup_env.py — the model download command
  • README.md (two manual-download examples) and gpu/README.md

hf download <repo> --local-dir <path> takes the same arguments as the legacy huggingface-cli download, so the swap is behavior-preserving on supported huggingface_hub versions.

Issues Fix #560

Test verification (RED → GREEN)

Added tests/test_setup_env_download.py (stdlib unittest, no new dependency), which drives prepare_model() and asserts the download command uses hf.

RED — on unmodified main (before the fix):

FAIL: test_download_uses_current_hf_cli
AssertionError: 'huggingface-cli' != 'hf'
- huggingface-cli
+ hf
Ran 1 test in 0.001s
FAILED (failures=1)

GREEN — with the fix:

test_download_uses_current_hf_cli ... ok
Ran 1 test in 0.000s
OK

`huggingface-cli` was removed from recent huggingface_hub releases; the
current CLI entry point is `hf`. The documented `-hr/--hf-repo` download
flow therefore fails with "command not found". Update the download command
in setup_env.py and the matching README / gpu/README instructions to use
`hf download`, which takes the same arguments.

Adds a stdlib-unittest regression test asserting the download command uses
`hf`.

Fixes microsoft#560

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

Warning: huggingface-cli is deprecated and no longer works. Use hf instead.

1 participant