Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/huggingface/space_readme_header.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ colorTo: indigo
sdk: gradio
app_file: space_app.py
python_version: "3.12"
suggested_hardware: cpu-basic
pinned: false
license: mpl-2.0
short_description: Browse, theme-classify and topic-model conference papers
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ Action mirrors `main` to the Space on every push, so it stays in sync.
**One-time setup:**

1. **Create the Space** — on <https://huggingface.co/new-space>, pick **Gradio →
Blank**, and note its owner + name (e.g. `your-user/conflens`).
Blank**, **CPU basic** hardware (this app is CPU-only; ZeroGPU errors with
*"No @spaces.GPU function detected"*), and note its owner + name (e.g.
`your-user/conflens`).
2. **Give GitHub a token** — create a Hugging Face access token with **write**
scope (Settings → Access Tokens) and add it to this GitHub repo as a secret
named **`HF_TOKEN`** (Settings → Secrets and variables → Actions).
Expand Down
15 changes: 14 additions & 1 deletion space_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,26 @@
The Space's README metadata sets ``app_file: space_app.py``. HF imports this
module, finds the module-level ``demo`` and serves it. Running it directly
(``python space_app.py``) launches locally too.

The Space runs on free **CPU** hardware, so Gradio's SSR (which spawns a Node
sidecar) is disabled — the app is plain server-rendered Python. Set the Space
hardware to *CPU basic*; ZeroGPU hardware would error with "No @spaces.GPU
function detected" because this app has no GPU code.
"""

import os

from conflens.gradio_app import build_demo

# Disable Gradio SSR (Node proxy) — set before any launch, whether HF launches
# `demo` itself or this file is run directly.
os.environ.setdefault("GRADIO_SSR_MODE", "false")

demo = build_demo()

if __name__ == "__main__":
demo.launch(server_name="0.0.0.0", server_port=int(os.environ.get("PORT", "7860")))
demo.launch(
server_name="0.0.0.0",
server_port=int(os.environ.get("PORT", "7860")),
ssr_mode=False,
)
Loading