cstr commited on
Commit
558d6bc
·
verified ·
1 Parent(s): 8b246e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -794,16 +794,18 @@ with gr.Blocks(theme=gr.themes.Default()) as demo:
794
  (copy_summary_button, "summary_output")
795
  ]:
796
  btn.click(
797
- fn=None,
798
- _js=copy_text_js(elem_id),
799
- outputs=progress_status
 
800
  )
801
 
802
  # ChatGPT handler
803
  open_chatgpt_button.click(
804
- fn=None,
805
- _js="() => { window.open('https://chat.openai.com/', '_blank'); return 'Opened ChatGPT in new tab'; }",
806
- outputs=progress_status
 
807
  )
808
 
809
  # Model processing
 
794
  (copy_summary_button, "summary_output")
795
  ]:
796
  btn.click(
797
+ fn=lambda _: f"const text = document.querySelector('#{elem_id} textarea').value; navigator.clipboard.writeText(text); return 'Copied to clipboard!';",
798
+ inputs=None,
799
+ outputs=progress_status,
800
+ js=True
801
  )
802
 
803
  # ChatGPT handler
804
  open_chatgpt_button.click(
805
+ fn=lambda: "window.open('https://chat.openai.com/', '_blank'); return 'Opened ChatGPT in new tab';",
806
+ inputs=None,
807
+ outputs=progress_status,
808
+ js=True
809
  )
810
 
811
  # Model processing