| """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 |
| except Exception as exc: |
| |
| import logging |
| logging.getLogger(__name__).warning( |
| "demo_app import failed (%s); serving API only without /demo", exc |
| ) |
| from app_runtime import app |
|
|
| from app_runtime import main |
|
|
|
|
| if __name__ == "__main__": |
| main() |
|
|