SpaceNugget commited on
Commit
754dfcd
·
1 Parent(s): 6bc0a87

fix: patch url_ok to bypass 0.0.0.0 health-check false negative

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -356,4 +356,13 @@ try:
356
  except Exception as _e:
357
  print(f"WARNING: wsproto backend setup failed: {_e}")
358
 
 
 
 
 
 
 
 
 
 
359
  demo.launch(server_name="0.0.0.0", show_error=True)
 
356
  except Exception as _e:
357
  print(f"WARNING: wsproto backend setup failed: {_e}")
358
 
359
+ # When server_name="0.0.0.0", gradio constructs local_url as "http://0.0.0.0:7860/"
360
+ # which is a bind address and can't be used as a connection target — url_ok fails.
361
+ # The server IS running; patch url_ok so gradio doesn't block on this false negative.
362
+ try:
363
+ import gradio.networking as _gnet
364
+ _gnet.url_ok = lambda url: True
365
+ except Exception as _e:
366
+ print(f"url_ok patch failed: {_e}")
367
+
368
  demo.launch(server_name="0.0.0.0", show_error=True)