Spaces:
Sleeping
Sleeping
Download server/app.py from varun1235/RLhackathon: direct link, hf CLI and curl.
- Browser
- Download file 901 Bytes
-
https://huggingface.co/spaces/varun1235/RLhackathon/resolve/main/server/app.py
- Command line
-
hf download hf://spaces/varun1235/RLhackathon/server/app.py
-
curl -L -o app.py https://huggingface.co/spaces/varun1235/RLhackathon/resolve/main/server/app.py
901 Bytes
| """ | |
| server/app.py | |
| OpenEnv-core server with auto-generated UI. | |
| """ | |
| import sys | |
| import os | |
| import uvicorn | |
| # Add project root to path so imports work when run as module | |
| sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
| # Enable web interface for Gradio UI | |
| os.environ.setdefault("ENABLE_WEB_INTERFACE", "true") | |
| from openenv.core.env_server.http_server import create_app | |
| from env.environment import ISSEnvironment | |
| from env.objects import Action, Observation | |
| app = create_app( | |
| ISSEnvironment, | |
| Action, | |
| Observation, | |
| env_name="iss-safety-operations", | |
| max_concurrent_envs=1, | |
| ) | |
| # Add root health check (openenv-core only provides /health) | |
| def health(): | |
| return {"status": "ok", "environment": "iss-safety-operations", "version": "1.0.0"} | |
| def main(): | |
| uvicorn.run(app, host="0.0.0.0", port=7860) | |
| if __name__ == "__main__": | |
| main() | |