Gabriel commited on
Commit
f99e432
1 Parent(s): bc2654a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -3
app.py CHANGED
@@ -1,10 +1,22 @@
1
  import gradio as gr
2
 
3
 
4
- def greet(name):
5
- return "Hello " + name
6
 
7
 
8
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  demo.launch()
 
1
  import gradio as gr
2
 
3
 
4
+ def flip_text(x):
5
+ return x[::-1]
6
 
7
 
8
+ demo = gr.Blocks()
9
+
10
+ with demo:
11
+ gr.Markdown(
12
+ """
13
+ # Flip Text!
14
+ Start typing below to see the output.
15
+ """
16
+ )
17
+ input = gr.Textbox(placeholder="Flip this text")
18
+ output = gr.Textbox()
19
+
20
+ input.change(fn=flip_text, inputs=input, outputs=output)
21
 
22
  demo.launch()