promptstat / space_app.py
xxixx1028's picture
Deploy PromptStat — UI shell + MiniCPM4.1-8B + 4-LoRA hybrid (Modal)
dc9f530 verified
Raw
History Blame Contribute Delete
877 Bytes
"""Hugging Face Spaces entry point for the UI shell.
Spaces runs the file named in README.md `app_file`. We point that at THIS thin wrapper so the
existing backend `app.py` stays the source-of-truth for the backend workstream and is never the
Space entry. All this file does is build the `ui/` demo and launch it.
Gradio 6 takes `theme` / `css` / `head` on `launch()` (not on the Blocks constructor), so we own
the `launch()` call here to guarantee the dark theme + Chart.js/flip `head` injection are applied
exactly as they are locally. `demo` is exposed at module level for tooling (`gradio deploy`).
"""
from ui.app import build_demo
from ui.theme import base_theme, CSS, HEAD
demo = build_demo()
if __name__ == "__main__":
# Spaces executes this file as the main script; this launch() is what serves the app.
demo.launch(theme=base_theme(), css=CSS, head=HEAD)