Haoming02 commited on
Commit
78f93fb
·
verified ·
1 Parent(s): 216863a
Files changed (1) hide show
  1. app.py +21 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+
4
+ def greet(name: str) -> str:
5
+ return f"Hello, {name}!"
6
+
7
+
8
+ with gr.Blocks() as demo:
9
+
10
+ gr.Markdown("""<h1 align="center">Hello World</h1>""")
11
+ gr.Markdown("""<p align="center">Typing whatever you want to greet below:</p>""")
12
+
13
+ with gr.Row():
14
+ user_input = gr.Textbox(max_lines=1, interactive=True, placeholder="World")
15
+ text_output = gr.Textbox(max_lines=1, interactive=False)
16
+
17
+ btn = gr.Button("Run")
18
+ btn.click(fn=greet, inputs=[user_input], outputs=[text_output])
19
+
20
+
21
+ demo.launch()