Spaces:
Running
Running
Download src-python/start_server.py from blanchon/LeRobot-Arena: direct link, hf CLI and curl.
- Browser
- Download file 828 Bytes
-
https://huggingface.co/spaces/blanchon/LeRobot-Arena/resolve/main/src-python/start_server.py
- Command line
-
hf download hf://spaces/blanchon/LeRobot-Arena/src-python/start_server.py
-
curl -L -o start_server.py https://huggingface.co/spaces/blanchon/LeRobot-Arena/resolve/main/src-python/start_server.py
828 Bytes
| #!/usr/bin/env python3 | |
| """ | |
| LeRobot Arena WebSocket Server | |
| Run with: python start_server.py | |
| """ | |
| import logging | |
| import sys | |
| from pathlib import Path | |
| import uvicorn | |
| # Add src to path | |
| sys.path.insert(0, str(Path(__file__).parent / "src")) | |
| from src.main import app | |
| def main(): | |
| """Start the LeRobot Arena server""" | |
| logging.basicConfig( | |
| level=logging.INFO, | |
| format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", | |
| ) | |
| logger = logging.getLogger("lerobot-arena") | |
| logger.info("🚀 Starting LeRobot Arena WebSocket Server...") | |
| # Start the server on port 7860 for HF Spaces compatibility | |
| uvicorn.run( | |
| app, | |
| host="0.0.0.0", | |
| port=7860, | |
| log_level="info", | |
| reload=False, # Auto-reload on code changes | |
| ) | |
| if __name__ == "__main__": | |
| main() | |