PatSnap/Document-Processing
10
1---2title: Document Processing3emoji: 🦀4colorFrom: red5colorTo: indigo6sdk: gradio7sdk_version: 6.16.08python_version: '3.13'9app_file: app.py10pinned: false11license: apache-2.012short_description: Smart Doc + patent translation via connect gateway13---14 15# Document Processing16 17Gradio demo with two tabs sharing one Bearer API key from the environment.18 19## Tabs20 21| Tab | Gateway | Notes |22|-----|---------|--------|23| **Smart Doc** | `https://connect.zhihuiya.com/rd-llm/v1/documents/doc_parsing` | Multipart upload · `output_format=both` · **10 MB** max |24| **Translation** | `https://connect.zhihuiya.com/hiro_translation` | `stream`: SSE via `POST /translate`; `fast`: async submit + poll (`POST /translate/async` → `GET /translate/async/{taskId}`) |25 26## Auth27 28Set under Space **Settings → Variables / Secrets** (or local env):29 301. `HIRO_API_KEY` (preferred)312. else `RD_LLM_API_KEY`32 33No API key field in the UI.34 35## Files36 37| File | Purpose |38|------|---------|39| `app.py` | Gradio UI (tabs + streaming translation + document parse) |40| `api_client.py` | HTTP clients for translation + Smart Doc |41| `requirements.txt` | Python dependencies (`requests`; Gradio is pre-installed on Spaces) |42 43## Local run44 45```bash46pip install -r requirements.txt47export HIRO_API_KEY="sk-..." # or RD_LLM_API_KEY48python app.py49```50 51Check out the [Spaces config reference](https://huggingface.co/docs/hub/spaces-config-reference).52 