paulcalzada commited on
Commit
f36be73
·
verified ·
1 Parent(s): 1d668f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -15
app.py CHANGED
@@ -110,21 +110,14 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)") as demo:
110
  outputs=[out_code, retrieved_list, retrieved_raw]
111
  )
112
 
113
- # Use the `on_event` method to add the copy functionality
114
- copy_button.click(None, [out_code], None, _js="""
115
- (text) => {
116
- if (navigator.clipboard) {
117
- navigator.clipboard.writeText(text);
118
- return;
119
- }
120
- const el = document.createElement('textarea');
121
- el.value = text;
122
- document.body.appendChild(el);
123
- el.select();
124
- document.execCommand('copy');
125
- document.body.removeChild(el);
126
- }
127
- """)
128
 
129
  if __name__ == "__main__":
130
  if 'agent_module' in locals():
 
110
  outputs=[out_code, retrieved_list, retrieved_raw]
111
  )
112
 
113
+ # Use the `on()` method for the copy functionality
114
+ copy_button.on(
115
+ "click",
116
+ None,
117
+ _js="(text) => navigator.clipboard.writeText(text)",
118
+ inputs=[out_code]
119
+ )
120
+
 
 
 
 
 
 
 
121
 
122
  if __name__ == "__main__":
123
  if 'agent_module' in locals():