rishik1111 commited on
Commit
3625de9
·
1 Parent(s): a543b6f

feat: Optimize startup event handler for instant cloud port binding

Browse files
Files changed (1) hide show
  1. main.py +1 -7
main.py CHANGED
@@ -88,13 +88,7 @@ app.add_middleware(
88
  # Preload models and perform full pipeline warmup asynchronously at startup
89
  @app.on_event("startup")
90
  async def startup_event():
91
- async def run_warmup():
92
- print("[Space Startup] Preloading embedding model, FAISS indexes, and warming up pipeline...")
93
- orchestrator = get_orchestrator()
94
- await asyncio.to_thread(orchestrator.warmup_pipeline)
95
- print("[Space Startup] Full RAG pipeline preloaded and warmed up successfully.")
96
-
97
- asyncio.create_task(run_warmup())
98
 
99
 
100
  @app.get("/", response_class=HTMLResponse)
 
88
  # Preload models and perform full pipeline warmup asynchronously at startup
89
  @app.on_event("startup")
90
  async def startup_event():
91
+ print("[Space Startup] Server process started cleanly. Listening for connections...")
 
 
 
 
 
 
92
 
93
 
94
  @app.get("/", response_class=HTMLResponse)