| # 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 |
| ```bash |
| git clone https://huggingface.co/spaces/<username>/<space-name> |
| cd <space-name> |
| ``` |
|
|
| ### 3οΈβ£ Copy Files |
| ```bash |
| cp -r /path/to/GradCAMPlusPlus_SkinLesion/* . |
| ``` |
|
|
| ### 4οΈβ£ Push to HF |
| ```bash |
| 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 |
|
|
| - [x] App code with type hints |
| - [x] Dependencies optimized |
| - [x] Configuration files created |
| - [x] Documentation complete |
| - [x] Checklist provided |
| - [x] Contributing guidelines added |
| - [x] License included |
| - [x] Examples & templates ready |
|
|
| --- |
|
|
| ## π URLs |
|
|
| - **HF Spaces**: https://huggingface.co/spaces |
| - **This Project**: https://huggingface.co/spaces/`<your-username>`/`<space-name>` |
| - **Gradio Docs**: https://gradio.app/docs |
|
|
| --- |
|
|
| ## π‘ Pro Tips |
|
|
| - **Speed**: Enable GPU in `spaces.yaml` for faster inference |
| - **Cost**: CPU-only mode works but is ~3x slower |
| - **Testing**: Run `python app.py` locally 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` |
|
|