Skip to content

fix: evaluate-cli import error with huggingface-hub 1.0.0 - #791

Open
tonycoder-hub wants to merge 1 commit into
huggingface:mainfrom
tonycoder-hub:cursor/fix-huggingface-hub-1-0-compat-464e
Open

fix: evaluate-cli import error with huggingface-hub 1.0.0#791
tonycoder-hub wants to merge 1 commit into
huggingface:mainfrom
tonycoder-hub:cursor/fix-huggingface-hub-1-0-compat-464e

Conversation

@tonycoder-hub

Copy link
Copy Markdown

Fixes #712.

The HfFolder crash was already fixed in 0.4.6. evaluate-cli still imported huggingface_hub.Repository, which was removed in hub 1.0, so the console script could not start.

Replace Repository git helpers with the same plain-git subprocess path the CLI already used to clone. tests/test_evaluate_cli.py and related: 49 passed, 2 skipped.

huggingface_hub removed the git-based `Repository` class in v1.0.0, so
`from huggingface_hub import HfApi, Repository, create_repo` raises an
ImportError and the `evaluate-cli` entry point cannot start at all.

Replace the `Repository` add/commit/push calls with the same plain git
subprocess helper that is already used to clone the Space, which keeps the
local checkout and the printed instructions valid and works on both
huggingface-hub 0.x and 1.x.

Also raise the huggingface-hub floor to the version that first shipped
`huggingface_hub.utils.build_hf_headers`, and add cookiecutter to the test
extra so the CLI can be imported in CI.

Co-authored-by: Tony Coder <407243179@qq.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.

bug: huggingface-hub 1.0.0 release breaks existing evaluate releases

2 participants