You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(cli): m alora upload and add-readme fail with an ImportError on huggingface_hub 1.x (HfFolder removed) #1791
m alora upload and m alora add-readme fail straight away on a normal install, with an error that points you at the wrong thing.
With uv sync --all-extras (which gives you huggingface_hub 1.16.1) and no token set:
$ m alora upload ...
ImportError: The 'm alora upload' command requires extra dependencies. Please install them with: pip install "mellea[hf]"
add-readme does the same ("The 'm alora' command requires extra dependencies"). The hf extra is installed, so following the advice does nothing, and the code's own "Hugging Face token not found. Run huggingface-cli login first." message is never reached. That means the aLoRA walkthrough in docs/examples/aLora/README.md can't get past the upload step.
Cause
cli/alora/upload.py:15, cli/alora/commands.py:211 and cli/alora/intrinsic_uploader.py:20 import HfFolder from huggingface_hub inside a try/except ImportError. HfFolder was removed in huggingface_hub 1.0, so the import fails and the handler reports a missing extra. pyproject.toml allows huggingface-hub>=0.33.4, so 1.x is in range, and the lockfile resolves to 1.16.1.
I checked the attribute directly:
huggingface_hub
HfFolder
get_token
0.33.4
yes
yes
0.36.0
yes
yes
1.0.0
no
yes
1.16.1
no
yes
Suggested fix
Use huggingface_hub.get_token() instead of HfFolder.get_token() at the three call sites. It exists across the whole supported range. It would also be worth a test that imports these CLI modules against the locked huggingface_hub, so a removal like this fails in CI and not at the user's terminal.
Activity