Spaces:
Paused
Paused
init
Browse files
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()
|