β‘ Quick Start Guide - Hugging Face Deployment
π― 5-Minute Setup
Step 1: Create HF Spaces (2 min)
- Go to https://huggingface.co/spaces
- Create TWO spaces:
docling-apidocstrange-api
- Use Docker SDK for both
- Set to Public (free) or Private
Step 2: Upload Files (1 min)
For EACH space:
- Upload
app.pyfrom corresponding folder - Upload
requirements.txtfrom corresponding folder - Wait for deployment (2-3 min)
Step 3: Get Your URLs
After deployment:
- Docling:
https://YOUR_USERNAME-docling-api.hf.space - DocStrange:
https://YOUR_USERNAME-docstrange-api.hf.space
Step 4: Connect to DataSync (1 min)
- Open http://localhost:5000
- Go to Import Data β DocStrange tab
- Select engine:
π¬ Docling Hugging FaceORπ§ͺ DocStrange Hugging Face
- Paste your HF URL
- Upload PDF and extract!
π§ͺ Test Your APIs
# Test both APIs
cd huggingface_deploy\test-scripts
python test_docling.py https://YOUR_USERNAME-docling-api.hf.space
python test_docstrange.py https://YOUR_USERNAME-docstrange-api.hf.space
β You're Done!
Both APIs are now integrated with DataSync and ready to extract documents!
π Troubleshooting
| Problem | Solution |
|---|---|
| Space not deploying | Check Docker logs in HF Space settings |
| API returns 500 | Verify requirements.txt uploaded |
| Timeout errors | PDF too large - try smaller file |
| Not working in DataSync | Check URL format (no trailing slash) |
π Next Steps
- Try different engines for comparison
- Map extracted columns to ERPNext
- Download CSV/JSON of extracted data
Happy extracting! π