ShermanAI commited on
Commit
b05100b
·
1 Parent(s): cd79030

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -37,13 +37,13 @@ outputs = ["chatbot", "state"]
37
  interface = gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title=title, description=description, examples=examples)
38
 
39
  # Add JavaScript code to reset the input textbox value on the client side
40
- interface.script("""
41
- function resetInput() {
42
- document.getElementById("input-textbox").value = "";
43
- }
 
 
 
44
  """)
45
 
46
- # Call the resetInput function when the user submits a question
47
- interface.layout.submit_button.onclick = "resetInput();"
48
-
49
  interface.launch(debug=True)
 
37
  interface = gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title=title, description=description, examples=examples)
38
 
39
  # Add JavaScript code to reset the input textbox value on the client side
40
+ interface.html("""
41
+ <script>
42
+ function resetInput() {
43
+ document.getElementById("input-textbox").value = "";
44
+ }
45
+ document.querySelector('[type="submit"]').addEventListener("click", resetInput);
46
+ </script>
47
  """)
48
 
 
 
 
49
  interface.launch(debug=True)