Spaces:
Runtime error
Runtime error
Wiktor Kolodziej
commited on
Commit
·
8621c14
1
Parent(s):
fdd6432
First try
Browse files
app.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
def update(name):
|
| 5 |
+
return f"Welcome to Gradio, {name}!"
|
| 6 |
+
|
| 7 |
+
demo = gr.Blocks()
|
| 8 |
+
|
| 9 |
+
with demo:
|
| 10 |
+
gr.Markdown(
|
| 11 |
+
"""
|
| 12 |
+
# Hello World!
|
| 13 |
+
Start typing below to see the output.
|
| 14 |
+
""")
|
| 15 |
+
inp = gr.Textbox(placeholder="What is your name?")
|
| 16 |
+
out = gr.Textbox()
|
| 17 |
+
|
| 18 |
+
inp.change(fn=update,
|
| 19 |
+
inputs=inp,
|
| 20 |
+
outputs=out)
|
| 21 |
+
|
| 22 |
+
gr.Image("lion.jpg").style(height=54, width=240)
|
| 23 |
+
|
| 24 |
+
demo.launch()
|
lion.jpg
ADDED
|