Spaces:
Running
Running
File size: 532 Bytes
b58824d |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
# start.py
import subprocess, sys, os
# allow imports from backend/ if needed
sys.path.insert(0, os.path.join(os.getcwd(), "backend"))
print("Running backend/download_models.py ...")
ret = subprocess.run([sys.executable, "backend/download_models.py"])
if ret.returncode != 0:
print("Warning: download_models.py exited non-zero; continuing to start server for debugging...")
print("Starting Uvicorn on port 7860 ...")
subprocess.run([sys.executable, "-m", "uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"]) |