Divyab2004 commited on
Commit
b58824d
·
verified ·
1 Parent(s): 347daa6

Create start.py

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