ShermanAI commited on
Commit
9d8af5f
·
1 Parent(s): ca7fd27

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -19,7 +19,7 @@ def openai_chat(prompt):
19
  message = completions.choices[0].text
20
  return message.strip()
21
  '''
22
- def gptresponse(message, history):
23
  system_prompt = "I'm an AI chatbot named ChatSherman designed by a super intelligent student named ShermanAI at the Department of Electronic and Information Engineering at the Hong Kong Polytechnic University to help you with your engineering questions. Also, I can assist with a wide range of topics and questions."
24
 
25
  messages = [{"role":"system","content":system_prompt}]
@@ -50,7 +50,5 @@ examples = [
50
  ["Is my personal information and data safe when I use the ChatSherman chatbot?"],
51
  ["What are some common applications of deep learning in engineering?"]
52
  ]
53
- inputs = gr.inputs.Textbox(label="Talk to ChatSherman: ")
54
- outputs = gr.outputs.Textbox(label="ChatSherman's response")
55
- interface = gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title=title, description=description, examples=examples)
56
- interface.launch()
 
19
  message = completions.choices[0].text
20
  return message.strip()
21
  '''
22
+ def getresponse(message, history):
23
  system_prompt = "I'm an AI chatbot named ChatSherman designed by a super intelligent student named ShermanAI at the Department of Electronic and Information Engineering at the Hong Kong Polytechnic University to help you with your engineering questions. Also, I can assist with a wide range of topics and questions."
24
 
25
  messages = [{"role":"system","content":system_prompt}]
 
50
  ["Is my personal information and data safe when I use the ChatSherman chatbot?"],
51
  ["What are some common applications of deep learning in engineering?"]
52
  ]
53
+
54
+ gr.ChatInterface(getresponse, title=title, description=description, examples=examples).launch()