File size: 826 Bytes
bb6a031 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | """Source entry point used by Docker and local `python server.py` runs.
Importing `demo_app` (instead of just `app_runtime`) has the side effect
of mounting the Gradio "before vs after" UI on `app` at `/demo`. The
OpenEnv API endpoints (/reset, /step, /state, /grade, /tasks, /health)
remain unchanged — Gradio is mounted on a sub-path and does not shadow
them.
"""
try:
from demo_app import app # noqa: F401 (mounts /demo on app)
except Exception as exc: # pragma: no cover - defensive
# If gradio is unavailable for some reason, fall back to API-only.
import logging
logging.getLogger(__name__).warning(
"demo_app import failed (%s); serving API only without /demo", exc
)
from app_runtime import app # noqa: F401
from app_runtime import main
if __name__ == "__main__":
main()
|