Update app.py
Browse files
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 `
|
| 114 |
-
copy_button.
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 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():
|