Spaces:
Paused
Paused
Download main.py from Testing-Lab/sv2: direct link, hf CLI and curl.
- Browser
- Download file 525 Bytes
-
https://huggingface.co/spaces/Testing-Lab/sv2/resolve/main/main.py
- Command line
-
hf download hf://spaces/Testing-Lab/sv2/main.py
-
curl -L -o main.py https://huggingface.co/spaces/Testing-Lab/sv2/resolve/main/main.py
525 Bytes
| import subprocess | |
| import threading | |
| from fastapi import FastAPI | |
| import uvicorn | |
| app = FastAPI() | |
| def root(): | |
| return {"status": "Driver is running. Web status OK."} | |
| def start_driver(): | |
| print("[INFO] Starting shadow driver...", flush=True) | |
| subprocess.call(["/entrypoint.sh"]) | |
| def start_api(): | |
| print("[INFO] FastAPI running on port 8000", flush=True) | |
| uvicorn.run(app, host="0.0.0.0", port=8000) | |
| if name == "main": | |
| threading.Thread(target=start_driver, daemon=True).start() | |
| start_api() |