|
|
@@ -694,39 +694,16 @@ with gr.Blocks(
|
|
|
# gr.Markdown("Technical details", elem_classes=["info-text"])
|
|
|
|
|
|
|
|
|
-def setup_gui(enable_gradio_share=False):
|
|
|
- if(enable_gradio_share):
|
|
|
- try:
|
|
|
- demo.launch(server_name="0.0.0.0", debug=True, inbrowser=True, share=True)
|
|
|
- except Exception:
|
|
|
- print(
|
|
|
- "Error launching GUI using 0.0.0.0.\nThis may be caused by global mode of proxy software."
|
|
|
- )
|
|
|
- try:
|
|
|
- demo.launch(
|
|
|
- server_name="127.0.0.1", debug=True, inbrowser=True, share=True
|
|
|
- )
|
|
|
- except Exception:
|
|
|
- print(
|
|
|
- "Error launching GUI using 127.0.0.1.\nThis may be caused by global mode of proxy software."
|
|
|
- )
|
|
|
- demo.launch(server_name="0.0.0.0", debug=True, inbrowser=True, share=True)
|
|
|
- else:
|
|
|
+def setup_gui(share=False):
|
|
|
+ try:
|
|
|
+ demo.launch(server_name="0.0.0.0", debug=True, inbrowser=True, share=share)
|
|
|
+ except Exception:
|
|
|
+ print("Error launching GUI using 0.0.0.0.\nThis may be caused by global mode of proxy software.")
|
|
|
try:
|
|
|
- demo.launch(server_name="0.0.0.0", debug=True, inbrowser=True, share=False)
|
|
|
+ demo.launch(server_name="127.0.0.1", debug=True, inbrowser=True, share=share)
|
|
|
except Exception:
|
|
|
- print(
|
|
|
- "Error launching GUI using 0.0.0.0.\nThis may be caused by global mode of proxy software."
|
|
|
- )
|
|
|
- try:
|
|
|
- demo.launch(
|
|
|
- server_name="127.0.0.1", debug=True, inbrowser=True, share=False
|
|
|
- )
|
|
|
- except Exception:
|
|
|
- print(
|
|
|
- "Error launching GUI using 127.0.0.1.\nThis may be caused by global mode of proxy software.Force enable Gradio sharing feature."
|
|
|
- )
|
|
|
- demo.launch(server_name="0.0.0.0", debug=True, inbrowser=True, share=True)
|
|
|
+ print("Error launching GUI using 127.0.0.1.\nThis may be caused by global mode of proxy software.")
|
|
|
+ demo.launch(debug=True, inbrowser=True, share=True)
|
|
|
|
|
|
# For auto-reloading while developing
|
|
|
if __name__ == "__main__":
|