bhardwaj08sarthak commited on
Commit
3e4013c
·
verified ·
1 Parent(s): 18801af

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -418,4 +418,11 @@ with gr.Blocks() as demo:
418
  )
419
 
420
  if __name__ == "__main__" or os.getenv("SYSTEM") == "spaces":
 
 
 
 
 
 
 
421
  demo.launch()
 
418
  )
419
 
420
  if __name__ == "__main__" or os.getenv("SYSTEM") == "spaces":
421
+ if __name__ == "__main__" or os.getenv("SYSTEM") == "spaces":
422
+ try:
423
+ load_model() # triggers GPU allocation during startup
424
+ except Exception as e:
425
+ # don't crash the app if warmup fails; logs will show details
426
+ print("Warmup failed:", e)
427
+
428
  demo.launch()