SnowFlash383935 commited on
Commit
411537a
·
verified ·
1 Parent(s): 4f445d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -5
app.py CHANGED
@@ -1,8 +1,23 @@
1
  import gradio as gr
 
 
 
2
 
3
- """def greet(name):
4
- return "Hello " + name + "!!"
 
 
 
 
 
 
5
 
6
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- demo.launch()"""
8
- gr.themes.builder()
 
 
 
 
 
 
 
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()