Spaces:
Sleeping
Sleeping
File size: 1,390 Bytes
ad5d213 | 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 49 50 51 52 53 54 55 56 | # π§ͺ DocStrange API Deployment Guide
## π¦ **Files in This Folder**
- `app.py` - FastAPI application for DocStrange extraction
- `requirements.txt` - Python dependencies
- `Dockerfile` - Container configuration
## π **Deploy to Hugging Face**
### **Method 1: Via Web UI (Easiest)**
1. Go to **https://huggingface.co/spaces**
2. Click **Create new Space**
3. **Name**: `docstrange-api`
4. **SDK**: `Docker**
5. **Visibility**: `Public` (free) or `Private` (needs token)
6. Click **Create Space**
7. Upload `app.py` and `requirements.txt`
8. Wait 3-5 minutes for deployment
### **Method 2: Via Git**
```bash
git clone https://huggingface.co/spaces/YOUR_USERNAME/docstrange-api
cd docstrange-api
cp app.py requirements.txt Dockerfile .
git add .
git commit -m "Deploy DocStrange API"
git push
```
## π§ͺ **Test Your Deployment**
```bash
cd test-scripts
python test_docstrange.py https://YOUR_USERNAME-docstrange-api.hf.space
```
## π‘ **API Documentation**
Once deployed, visit: `https://YOUR_USERNAME-docstrange-api.hf.space/docs`
## π§ **Endpoints**
- `GET /` - Health check
- `POST /extract` - Full document extraction
- `POST /extract/markdown` - Markdown/text only
- `POST /extract/tables` - Tables only
## π‘ **Tips**
- DocStrange supports GPU mode if available
- Automatic GPU detection in the API
- Works with any document format (PDF, DOCX, Images, etc.)
|