Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,23 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
gr.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
jsf = """
|
3 |
+
function refresh() {
|
4 |
+
const url = new URL(window.location);
|
5 |
|
6 |
+
if (url.searchParams.get('__theme') !== 'dark') {
|
7 |
+
url.searchParams.set('__theme', 'dark');
|
8 |
+
window.location.href = url.href;
|
9 |
+
}
|
10 |
+
}
|
11 |
+
"""
|
12 |
+
def update(name):
|
13 |
+
return f"Welcome to Gradio, {name}!"
|
14 |
|
15 |
+
with gr.Blocks(theme='SnowFlash383935/DarkEmerald', js=jsf) as demo:
|
16 |
+
gr.Markdown("Start typing below and then click **Run** to see the output.")
|
17 |
+
with gr.Row():
|
18 |
+
inp = gr.Textbox(placeholder="What is your name?")
|
19 |
+
out = gr.Textbox()
|
20 |
+
btn = gr.Button("Run")
|
21 |
+
btn.click(fn=update, inputs=inp, outputs=out)
|
22 |
+
|
23 |
+
demo.launch()
|