ZhiqiEliWang/SPADE
0
What this repo provides
app.py: Hugging Face Space backend pipeline (x -> detector -> explainer)docs/: GitHub Pages demo frontend that calls the Space API
Backend (Hugging Face Space)
This repo is configured as a Gradio Space (sdk: gradio).
API endpoint
- Endpoint name:
/pipeline - Input:
text(string) - Output (streamed updates):
[detector_output_json_or_partial, explainer_markdown_or_partial]
Replace with your paper models
In app.py, replace:
run_detector(text)with your detector inferencerun_explainer(text, detector_output)with your explainer inference
The pipeline order is already implemented in pipeline(text).
Frontend (GitHub Project Page)
The static site lives in docs/:
docs/index.htmldocs/app.jsdocs/config.jsdocs/styles.css
Configure Space ID
The GitHub Pages frontend in docs/ is fixed to:
ZhiqiEliWang/SPADE
docs/app.js always connects to that Space when running the pipeline. It uses app.submit("/pipeline", { text }) to render streamed output chunks on the page.
Enable GitHub Pages
In GitHub repo settings:
- Open
Settings -> Pages - Set source to
Deploy from a branch - Select branch
mainand folder/docs - Save
Your demo will be published at:
https://<your-github-username>.github.io/<repo-name>/
Local run (optional)
pip install -r requirements.txt
python app.pyThen open docs/index.html in a local static server if needed.
