ShermanAI commited on
Commit
800b433
·
1 Parent(s): ccbcaeb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -10
app.py CHANGED
@@ -19,20 +19,18 @@ def openai_chat(prompt):
19
  message = completions.choices[0].text
20
  return message.strip()
21
 
22
- def chatbot(talk_to_chatsherman, history=[]):
23
  output = openai_chat(talk_to_chatsherman)
24
- history.append((talk_to_chatsherman, output))
25
- return history, history
26
 
27
  title = "ChatSherman"
28
  description = "This is an AI chatbot powered by ShermanAI. Enter your question below to get started."
29
  examples = [
30
- ["What is ChatSherman, and how does it work?", []],
31
- ["Is my personal information and data safe when I use the ChatSherman chatbot?", []],
32
- ["What are some common applications of deep learning in engineering?", []]
33
  ]
34
- inputs = [gr.inputs.Textbox(label="Talk to ChatSherman: "), "state"]
35
- outputs = ["chatbot", "state"]
36
  interface = gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title=title, description=description, examples=examples)
37
- interface.launch(debug=True)
38
- #try
 
19
  message = completions.choices[0].text
20
  return message.strip()
21
 
22
+ def chatbot(talk_to_chatsherman):
23
  output = openai_chat(talk_to_chatsherman)
24
+ return output
 
25
 
26
  title = "ChatSherman"
27
  description = "This is an AI chatbot powered by ShermanAI. Enter your question below to get started."
28
  examples = [
29
+ ["What is ChatSherman, and how does it work?"],
30
+ ["Is my personal information and data safe when I use the ChatSherman chatbot?"],
31
+ ["What are some common applications of deep learning in engineering?"]
32
  ]
33
+ inputs = gr.inputs.Textbox(label="Talk to ChatSherman: ")
34
+ outputs = gr.outputs.Textbox(label="ChatSherman's response")
35
  interface = gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title=title, description=description, examples=examples)
36
+ interface.launch()