Wauplin HF staff commited on
Commit
3110228
1 Parent(s): 0a8f1f6

fix port + monketpatch

Browse files
Files changed (1) hide show
  1. app.py +13 -3
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import gradio as gr
 
2
 
3
  from auth import attach_oauth
4
 
@@ -36,6 +37,15 @@ with gr.Blocks() as demo:
36
  output = gr.Markdown()
37
  profile_btn.click(fn=show_profile, outputs=output)
38
 
39
- demo.launch(prevent_thread_lock=True, server_port=5173)
40
- attach_oauth(demo.server_app)
41
- demo.block_thread()
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ import gradio.blocks
3
 
4
  from auth import attach_oauth
5
 
 
37
  output = gr.Markdown()
38
  profile_btn.click(fn=show_profile, outputs=output)
39
 
40
+ old_start_server = gradio.blocks.networking.start_server
41
+
42
+
43
+ def patched_start_server(*args, **kwargs):
44
+ server_name, server_port, local_url, app, server = old_start_server(*args, **kwargs)
45
+ attach_oauth(app)
46
+ return server_name, server_port, local_url, app, server
47
+
48
+
49
+ gradio.blocks.networking.start_server = patched_start_server
50
+
51
+ demo.launch()