Thiru1122 commited on
Commit
296847d
·
verified ·
1 Parent(s): 9adf1b0

Keep main process alive after launch

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -320,4 +320,12 @@ with gr.Blocks(title="UniversalFakeDetect - Single Image Analysis") as demo:
320
  )
321
 
322
  if __name__ == "__main__":
323
- demo.launch(ssr_mode=False, css=custom_css)
 
 
 
 
 
 
 
 
 
320
  )
321
 
322
  if __name__ == "__main__":
323
+ demo.launch(server_name="0.0.0.0", server_port=7860, ssr_mode=False, css=custom_css)
324
+ try:
325
+ demo.block_till_done()
326
+ except (KeyboardInterrupt, SystemExit):
327
+ pass
328
+ except Exception as e:
329
+ print(f"[UniversalFakeDetect] Keep-alive notice: {e}")
330
+ while True:
331
+ time.sleep(3600)