feeday commited on
Commit
acbc881
·
verified ·
1 Parent(s): 1f02517

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -16,6 +16,10 @@ def translate_en_to_zh(text):
16
  def swap_text(input_text, output_text):
17
  return output_text, input_text
18
 
 
 
 
 
19
  with gr.Blocks() as demo:
20
  input_text = gr.Textbox(lines=2, placeholder="Enter text here...", label="Input Text")
21
  output_text = gr.Textbox(lines=2, label="Translated Text")
 
16
  def swap_text(input_text, output_text):
17
  return output_text, input_text
18
 
19
+ def copy_to_clipboard(output_text):
20
+ pyperclip.copy(output_text)
21
+ return "Text copied!"
22
+
23
  with gr.Blocks() as demo:
24
  input_text = gr.Textbox(lines=2, placeholder="Enter text here...", label="Input Text")
25
  output_text = gr.Textbox(lines=2, label="Translated Text")