ShermanAI commited on
Commit
930cdf3
·
1 Parent(s): 658baf1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -23,10 +23,7 @@ def openai_chat(prompt):
23
  def chatbot(talk_to_chatsherman, history=[]):
24
  output = openai_chat(talk_to_chatsherman)
25
  history.append((talk_to_chatsherman, output))
26
- return history, history
27
-
28
- def clear_textbox():
29
- document.getElementById("input-textbox").value = "";
30
 
31
  title = "ChatSherman"
32
  description = "This is an AI chatbot powered by ShermanAI."
@@ -35,7 +32,7 @@ examples = [
35
  ["Can you explain the concept of electrical conductivity?", []],
36
  ["How do you calculate the force required to move an object?", []]
37
  ]
38
- inputs = [gr.inputs.Textbox(label="Enter your question: ", onchange="clear_textbox()"), "state"]
39
- outputs = ["chatbot", "state"]
40
  interface = gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title=title, description=description, examples=examples)
41
  interface.launch(debug=True)
 
23
  def chatbot(talk_to_chatsherman, history=[]):
24
  output = openai_chat(talk_to_chatsherman)
25
  history.append((talk_to_chatsherman, output))
26
+ return history, ""
 
 
 
27
 
28
  title = "ChatSherman"
29
  description = "This is an AI chatbot powered by ShermanAI."
 
32
  ["Can you explain the concept of electrical conductivity?", []],
33
  ["How do you calculate the force required to move an object?", []]
34
  ]
35
+ inputs = [gr.inputs.Textbox(label="Enter your question: "), "state"]
36
+ outputs = ["chatbot", gr.outputs.Textbox(label="")]
37
  interface = gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title=title, description=description, examples=examples)
38
  interface.launch(debug=True)