Spaces:
Sleeping
Sleeping
Hugging Face Spaces Deployment Guide
Environment Variables
Required Secrets
Set these in your Hugging Face Space settings:
- HF_TOKEN: Your Hugging Face access token
- Go to: https://huggingface.co/settings/tokens
- Create a new token with read access
- Add as a secret in your Space settings
Hardware Requirements
- Recommended: T4 Small or higher for optimal performance
- Minimum: CPU (slower inference)
- Memory: At least 8GB RAM recommended
- Storage: 10GB+ for model caching
Deployment Steps
Push all files to your HF Space repository:
git add . git commit -m "Deploy tattoo search engine" git pushSet the HF_TOKEN secret in Space settings
The Space will automatically build and deploy
Testing
Once deployed, test these endpoints:
GET /health- Health checkGET /models- Available modelsPOST /search- Upload image and search
Troubleshooting
Common Issues:
- Missing HF_TOKEN: Set the token in Space secrets
- Model loading errors: Check hardware requirements
- Timeout errors: Consider upgrading to GPU hardware
- Memory errors: Upgrade to larger hardware tier
Logs:
Check the Space logs for detailed error messages and startup information.