Spaces:
Sleeping
Sleeping
Download server/app.py from sharancreates/openenv_hackathon: direct link, hf CLI and curl.
- Browser
- Download file 803 Bytes
-
https://huggingface.co/spaces/sharancreates/openenv_hackathon/resolve/main/server/app.py
- Command line
-
hf download hf://spaces/sharancreates/openenv_hackathon/server/app.py
-
curl -L -o app.py https://huggingface.co/spaces/sharancreates/openenv_hackathon/resolve/main/server/app.py
803 Bytes
| import sys | |
| import os | |
| sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
| from openenv.core.env_server import create_fastapi_app | |
| from env import CodeReviewEnv | |
| from models import Action, Observation | |
| # Create the FastAPI app | |
| app = create_fastapi_app(CodeReviewEnv, Action, Observation) | |
| def startup_event(): | |
| # Run the continuous inference/benchmark in the background | |
| # This ensures logs appear in the console while the server stays alive | |
| import threading | |
| from inference import run_inference | |
| print("🚀 Auto-starting inference engine...", flush=True) | |
| threading.Thread(target=run_inference, daemon=True).start() | |
| def main(): | |
| import uvicorn | |
| uvicorn.run(app, host="0.0.0.0", port=8000) | |
| if __name__ == "__main__": | |
| main() | |