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: missing friendly ImportError for m alora add-readme without [hf] #855
m alora add-readme crashes with a raw ModuleNotFoundError when huggingface_hub is not installed, rather than the friendly install hint used by every other CLI command.
Steps to reproduce
pip install "mellea[cli]"# without [hf]
m alora add-readme data.jsonl --basemodel gpt2 --name myorg/mymodel
Actual output:
ModuleNotFoundError: No module named 'huggingface_hub'
Expected output (consistent with m alora train, m serve, etc.):
ImportError: The 'm alora' command requires extra dependencies.
Please install them with: pip install "mellea[hf]"
Root cause
cli/alora/commands.py:155 imports huggingface_hub directly inside the function body without a guard:
defalora_add_readme(...):
fromhuggingface_hubimportHfFolder, create_repo, upload_file# no try/except
All other commands lazy-import their heavy dependencies with a try/except ImportError block pointing to the correct extra. This one was missed.
Found during
Code review and isolated-environment testing of PR #789, which introduced the friendly import error pattern across the rest of the CLI.
Fix
Wrap the huggingface_hub import in alora_add_readme with the same guard pattern used elsewhere:
try:
fromhuggingface_hubimportHfFolder, create_repo, upload_fileexceptImportErrorase:
raiseImportError(
"The 'm alora' command requires extra dependencies. "'Please install them with: pip install "mellea[hf]"'
) frome
Activity