Spaces:
Sleeping
Sleeping
File size: 1,343 Bytes
01a84b4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | # π 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! π
|