Spaces:
Runtime error
Fix startup crash: ImportError (hf-hub-api-removed)
Hi! This Space currently fails to start on Hugging Face with:
ImportError: cannot import name 'HfFolder' from 'huggingface_hub' (/home/user/.pyenv/versions/3.10.20/lib/python3.10/site-packages/huggingface_hub/__init__.py)
Cause. gradio 4.37.2's oauth module imports HfFolder from huggingface_hub, but the rebuild resolved a newer huggingface_hub where it is removed: ImportError: cannot import name 'HfFolder' from 'huggingface_hub'. Pinning the dependency set to the gradio 4.37 era restores the expected API.
Change. README.md, requirements.txt. requirements.txt is a lockfile resolved as of 2024-09-01 (Python 3.10), so the app runs on the library versions it was written for. python_version is pinned in the README to the interpreter we tested with. Nothing else is touched.
Tested. We rebuilt the Space with this patch the way Spaces builds it (README front-matter, requirements.txt, then the SDK), on an NVIDIA A10G (same GPU as a10g-small). The app started, and calling its /predict endpoint returned:
'အရာဉ်ကလည်းပြောက်နေပြီးတော့အခုအောက်တိုဘာလစမ်းပိုင်းကစပြီးအများဆုံးတွေ့လာရတာဖြစ်ပါတယ်'
The diagnosis and patch were written by Beam (Reflection AI's open model) as part of Space Doctor, a Build with Beam challenge project that repairs broken Spaces and only proposes fixes that pass this check. We read the diff before opening this PR. Feel free to close it if you'd rather fix it another way.