File size: 316 Bytes
c1f14d7
8427df2
c1f14d7
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import gradio as gr
js = '''alert("aaa");console.log("bbb Loaded.");'''

with gr.Blocks() as demo:
    inp = gr.Textbox(label="Input")
    out = gr.Textbox(label="Output")

    def reverse_text(text):
        return text[::-1]

    inp.change(reverse_text, inp, out)
    demo.load(None,None,None,js=js)
demo.launch()