realmanise commited on
Commit
5da44cf
·
verified ·
1 Parent(s): df2db34

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -5,6 +5,7 @@ import keras
5
  import zipfile
6
  import json
7
  import os
 
8
 
9
  # 1. Stand-in function for your model's Lambda layer structure
10
  def preprocess_input(x):
@@ -69,5 +70,9 @@ demo = gr.Interface(
69
  api_name="predict"
70
  )
71
 
72
- # CRUCIAL: block=True forces the Python execution process to hold open indefinitely
73
- demo.launch(block=True)
 
 
 
 
 
5
  import zipfile
6
  import json
7
  import os
8
+ import time
9
 
10
  # 1. Stand-in function for your model's Lambda layer structure
11
  def preprocess_input(x):
 
70
  api_name="predict"
71
  )
72
 
73
+ # Launch the interface safely with no unexpected keyword arguments
74
+ demo.launch()
75
+
76
+ # Keep the server background process alive indefinitely so the container doesn't exit
77
+ while True:
78
+ time.sleep(3600)