GradCAMPlusPlus_SkinLesion / QUICKSTART_HF.md
wyctorfogos's picture
update: Changes for production
3ce0f15
|
Raw
History Blame Contribute Delete
2.28 kB
# 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`