Spaces:
Sleeping
Sleeping
Download run_server.py from isHeSatoshi/RevLogiXenv: direct link, hf CLI and curl.
- Browser
- Download file 633 Bytes
-
https://huggingface.co/spaces/isHeSatoshi/RevLogiXenv/resolve/main/run_server.py
- Command line
-
hf download hf://spaces/isHeSatoshi/RevLogiXenv/run_server.py
-
curl -L -o run_server.py https://huggingface.co/spaces/isHeSatoshi/RevLogiXenv/resolve/main/run_server.py
633 Bytes
| """Single-command launcher for local OpenEnv API server.""" | |
| from __future__ import annotations | |
| import os | |
| from importlib import import_module | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| def main() -> None: | |
| os.environ.setdefault("ENV_README_PATH", os.path.abspath(os.path.join(os.path.dirname(__file__), "README.md"))) | |
| port = int(os.getenv("PORT", "8000")) | |
| app_module = import_module("server.app") | |
| app = getattr(app_module, "build_app")() | |
| print(f"API: http://localhost:{port}/") | |
| uvicorn = import_module("uvicorn") | |
| uvicorn.run(app, host="0.0.0.0", port=port) | |
| if __name__ == "__main__": | |
| main() | |