Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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.
|
41 |
-
|
42 |
-
|
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)
|