fix: evaluate-cli import error with huggingface-hub 1.0.0 - #791
Open
tonycoder-hub wants to merge 1 commit into
Open
fix: evaluate-cli import error with huggingface-hub 1.0.0#791tonycoder-hub wants to merge 1 commit into
tonycoder-hub wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.