content_processor / DEPLOY.md
satishsnv
first commit
01a84b4
|
Raw History Blame Contribute Delete
1.34 kB
# πŸš€ Quick Deployment to Hugging Face Spaces
## Files for Deployment
Upload these 4 files to your Hugging Face Space:
```
πŸ“ Your Hugging Face Space Repository
β”œβ”€β”€ πŸ“„ app.py # Main FastAPI application
β”œβ”€β”€ πŸ“„ Dockerfile # Container configuration
β”œβ”€β”€ πŸ“„ README.md # Space description (rename README_HF.md)
β”œβ”€β”€ πŸ“„ requirements.txt # Python dependencies
└── πŸ“„ test.py # Test script (optional)
```
## Deployment Steps
### 1. Create Hugging Face Space
- Go to [huggingface.co/spaces](https://huggingface.co/spaces)
- Click "Create new Space"
- Choose **SDK: Docker**
- Set your space name
### 2. Upload Files
- Upload: `app.py`, `Dockerfile`, `requirements.txt`
- **Rename** `README_HF.md` to `README.md` and upload
- Optionally upload `test.py`
### 3. Deploy
- Hugging Face automatically builds and deploys
- Your API will be available at: `https://your-space-name.hf.space`
## Testing
1. Update `test.py` with your Space URL
2. Set environment variable: `export OPENAI_API_KEY="your_key"`
3. Run: `python test.py`
## Your API Endpoints
- **Base**: `https://your-space-name.hf.space`
- **Health**: `GET /health`
- **Address Detection**: `POST /address-detection`
- **Summarization**: `POST /summarize`
- **Docs**: `GET /docs`
That's it! πŸŽ‰