rkihacker commited on
Commit
54de407
·
verified ·
1 Parent(s): 4dd154a

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -4
main.py CHANGED
@@ -7,16 +7,19 @@ app = FastAPI()
7
 
8
  @app.get("/")
9
  def root():
10
- return {"status": "Driver is running. Web status OK."}
11
 
12
  def start_driver():
13
- print("[INFO] Starting shadow driver...", flush=True)
14
  subprocess.call(["/entrypoint.sh"])
15
 
16
  def start_api():
17
  print("[INFO] FastAPI running on port 8000", flush=True)
18
  uvicorn.run(app, host="0.0.0.0", port=8000)
19
 
20
- if name == "main":
 
21
  threading.Thread(target=start_driver, daemon=True).start()
22
- start_api()
 
 
 
7
 
8
  @app.get("/")
9
  def root():
10
+ return {"status": "Ollama is running."}
11
 
12
  def start_driver():
13
+ print("[INFO] Starting Ubuntu driver...", flush=True)
14
  subprocess.call(["/entrypoint.sh"])
15
 
16
  def start_api():
17
  print("[INFO] FastAPI running on port 8000", flush=True)
18
  uvicorn.run(app, host="0.0.0.0", port=8000)
19
 
20
+ if __name__ == "__main__":
21
+ # Start driver in a background thread
22
  threading.Thread(target=start_driver, daemon=True).start()
23
+
24
+ # Start API in main thread
25
+ start_api()