Quick Reference: HuggingFace Deployment
π Deploy in 5 Steps
1οΈβ£ Create Space
Go to https://huggingface.co/spaces β New Space
- SDK: Gradio
- Python: 3.10
- Public: Yes
2οΈβ£ Clone Repository
git clone https://huggingface.co/spaces/<username>/<space-name>
cd <space-name>
3οΈβ£ Copy Files
cp -r /path/to/GradCAMPlusPlus_SkinLesion/* .
4οΈβ£ Push to HF
git add .
git commit -m "Deploy: Multimodal Skin Lesion App"
git push
5οΈβ£ Wait for Build
Monitor at: https://huggingface.co/spaces/<username>/<space-name>
π Key Files
| File | Purpose |
|---|---|
app.py |
Entry point |
requirements.txt |
Dependencies |
spaces.yaml |
HF config |
README.md |
Documentation |
DEPLOYMENT.md |
Detailed guide |
DEPLOYMENT_CHECKLIST.md |
Verification list |
CONTRIBUTING.md |
Contribution guide |
β What Was Prepared
- App code with type hints
- Dependencies optimized
- Configuration files created
- Documentation complete
- Checklist provided
- Contributing guidelines added
- License included
- Examples & templates ready
π URLs
- HF Spaces: https://huggingface.co/spaces
- This Project: https://huggingface.co/spaces/`
/` - Gradio Docs: https://gradio.app/docs
π‘ Pro Tips
- Speed: Enable GPU in
spaces.yamlfor faster inference - Cost: CPU-only mode works but is ~3x slower
- Testing: Run
python app.pylocally first - Debugging: Check Logs tab on HF Spaces
- Updates: Push changes and Space rebuilds automatically
β Troubleshooting
| Issue | Solution |
|---|---|
| Models not found | Verify data/weights/ in repo |
| Out of memory | Add GPU or reduce batch size |
| Build fails | Check Python 3.10 in spaces.yaml |
| Slow inference | Enable GPU in spaces.yaml |
π Resources
- Size: ~600 MB (4 models + preprocessing)
- RAM: 2-3 GB minimum
- Time: 30-60s first run, 5-15s cached
- GPU: Optional (A10G recommended)
Status: β DEPLOYMENT READY
Go forth and deploy! π
For detailed instructions, see DEPLOYMENT.md or DEPLOYMENT_CHECKLIST.md