Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def copy(src_sentence):
|
| 4 |
+
return src_sentence
|
| 5 |
+
|
| 6 |
+
with gr.Blocks(title="Copier") as demo:
|
| 7 |
+
gr.Markdown("# Copier")
|
| 8 |
+
with gr.Row():
|
| 9 |
+
with gr.Column():
|
| 10 |
+
src_sentence = gr.Textbox(label="Source text", placeholder="Write your text...")
|
| 11 |
+
with gr.Column():
|
| 12 |
+
tgt_sentence = gr.Textbox(label="Copy", placeholder="Copy will show here...")
|
| 13 |
+
btn = gr.Button("Copy!")
|
| 14 |
+
btn.click(fn=copy, inputs=[src_sentence], outputs=[tgt_sentence])
|