# Hugging Face Spaces Deployment Guide ## Environment Variables ### Required Secrets Set these in your Hugging Face Space settings: 1. **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 1. Push all files to your HF Space repository: ```bash git add . git commit -m "Deploy tattoo search engine" git push ``` 2. Set the HF_TOKEN secret in Space settings 3. The Space will automatically build and deploy ## Testing Once deployed, test these endpoints: - `GET /health` - Health check - `GET /models` - Available models - `POST /search` - Upload image and search ## Troubleshooting ### Common Issues: 1. **Missing HF_TOKEN**: Set the token in Space secrets 2. **Model loading errors**: Check hardware requirements 3. **Timeout errors**: Consider upgrading to GPU hardware 4. **Memory errors**: Upgrade to larger hardware tier ### Logs: Check the Space logs for detailed error messages and startup information.