File size: 362 Bytes
4bdb0b3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr

def flip_text(x):
    return x[::-1]

demo = gr.Blocks()

with demo:
    gr.Markdown(
    """
    # Flip Text!
    Start typing below to see the output.
    """)
    inp = gr.Textbox(placeholder="Flip this text")
    out = gr.Textbox()

    inp.change(fn=flip_text, 
                 inputs=inp, 
                 outputs=out)

demo.launch()