cazyundee commited on
Commit
b187817
·
verified ·
1 Parent(s): 4029ada

Disable watcher thread + explicit launch

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -208,4 +208,11 @@ def _patched_create_app(blocks, **kwargs):
208
 
209
  GradioApp.create_app = staticmethod(_patched_create_app)
210
 
 
 
 
 
 
 
211
  demo.queue(max_size=4, default_concurrency_limit=1)
 
 
208
 
209
  GradioApp.create_app = staticmethod(_patched_create_app)
210
 
211
+ # Disable the Gradio Spaces file watcher thread which crashes because
212
+ # importing `spaces` in a new thread after CUDA init fails.
213
+ import gradio.utils as _gr_utils
214
+ if hasattr(_gr_utils, "watchfn_spaces"):
215
+ _gr_utils.watchfn_spaces = lambda *a, **kw: None
216
+
217
  demo.queue(max_size=4, default_concurrency_limit=1)
218
+ demo.launch(ssr_mode=False)