| import gradio as gr | |
| def copy(src_sentence): | |
| return src_sentence | |
| with gr.Blocks(title="Copier") as demo: | |
| gr.Markdown("# Copier") | |
| with gr.Row(): | |
| with gr.Column(): | |
| src_sentence = gr.Textbox(label="Source text", placeholder="Write your text...") | |
| with gr.Column(): | |
| tgt_sentence = gr.Textbox(label="Copy", placeholder="Copy will show here...") | |
| btn = gr.Button("Copy!") | |
| btn.click(fn=copy, inputs=[src_sentence], outputs=[tgt_sentence]) | |
| demo.launch() |