arjunbhargav212's picture
Upload 12 files
ad5d213 verified

πŸ§ͺ 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

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

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.)