Spaces:
Runtime error
Runtime error
fix port + monketpatch
Browse files
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 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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()
|