Spaces:
Running
Running
| # 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"]) |