wenjiao commited on
Commit
37f0512
·
1 Parent(s): eacf5fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -19
app.py CHANGED
@@ -1,34 +1,33 @@
1
  import gradio as gr
2
  import os
3
 
 
4
 
5
- def combine(a, b):
6
- return a + " " + b
7
 
 
8
 
9
- def mirror(x):
10
- return x
11
 
 
 
 
 
12
 
13
- with gr.Blocks() as demo:
14
-
15
- change_language_radio = gr.Radio(["Chinese", "English"])
16
- language = gr.Textbox(label="Language")
17
- txt = gr.Textbox(label="Input", lines=2)
18
- txt_2 = gr.Textbox(label="Input 2")
19
- txt_3 = gr.Textbox(value="", label="Output")
20
- btn = gr.Button(value="Submit")
21
- btn.click(combine, inputs=[txt, txt_2], outputs=[txt_3])
22
 
23
- with gr.Row():
24
- im = gr.Image()
25
- im_2 = gr.Image()
 
 
 
26
 
27
- btn = gr.Button(value="Mirror Image")
28
- btn.click(mirror, inputs=[im], outputs=[im_2])
29
 
30
- change_language_radio.change(None, [], [language], _js="() => navigator.language")
31
 
32
 
 
 
33
  if __name__ == "__main__":
34
  demo.launch()
 
1
  import gradio as gr
2
  import os
3
 
4
+
5
 
6
+ language = ''
 
7
 
8
+
9
 
10
+ md = "test"
11
+ CN_md = "测试"
12
 
13
+ def initialize_interface():
14
+ print('hello')
15
+
16
+
17
 
 
 
 
 
 
 
 
 
 
18
 
19
+ with gr.Blocks() as demo:
20
+ gr.Markdown(md, _js="""
21
+ () => {
22
+ language = navigator.language;
23
+ }""")
24
+ gr.Markdown(language)
25
 
26
+
 
27
 
 
28
 
29
 
30
+
31
+
32
  if __name__ == "__main__":
33
  demo.launch()