Spaces:
Running on Zero
Running on Zero
Download app.py from Kedhareswer/docparse: direct link, hf CLI and curl.
- Browser
- Download file 633 Bytes
-
https://huggingface.co/spaces/Kedhareswer/docparse/resolve/main/app.py
- Command line
-
hf download hf://spaces/Kedhareswer/docparse/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Kedhareswer/docparse/resolve/main/app.py
633 Bytes
| # Entry point for the free Gradio-SDK Space: Spaces run `python app.py` and route | |
| # traffic to port 7860, so this starts docparse's own upload UI there. | |
| import os | |
| os.environ.setdefault("OMP_NUM_THREADS", "2") | |
| try: # ZeroGPU (the only free Gradio hardware) refuses to start without one | |
| import spaces | |
| def _unused(): | |
| pass | |
| # spaces normally reports this from gr.Blocks.launch, which this app never calls | |
| from spaces.zero import client | |
| client.startup_report() | |
| except ImportError: | |
| pass | |
| from docparse.ui import serve | |
| serve(port=7860, host="0.0.0.0", model="artifacts/docparse/ocr.pt") | |