traceforge / app.py
flozi00's picture
traceforge: pipeline behind a Gradio Space, keyed by content hash
0020de5 verified
Raw History Blame Contribute Delete
772 Bytes
"""Hugging Face Spaces entry point.
The Space runs this file. Everything it needs is in `traceforge/space/`;
configuration comes from Space secrets / variables:
TRACEFORGE_BASE_URL OpenAI-compatible endpoint (…/v1)
TRACEFORGE_LLM_KEY bearer token
TRACEFORGE_MODEL writer/judge model id
TRACEFORGE_TRIAGE_MODEL cheap labeler (default: TRACEFORGE_MODEL)
TRACEFORGE_DATA_DIR store root (default: ./data/space)
Locally: `python app.py` (or `traceforge space serve`).
"""
from __future__ import annotations
import os
from traceforge.space.app import CSS, build_app
demo = build_app()
demo.queue(default_concurrency_limit=4)
if __name__ == "__main__" or os.environ.get("SPACE_ID"):
demo.launch(show_error=True, css=CSS)