Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,7 +19,7 @@ def openai_chat(prompt):
|
|
| 19 |
message = completions.choices[0].text
|
| 20 |
return message.strip()
|
| 21 |
'''
|
| 22 |
-
def
|
| 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 |
-
|
| 54 |
-
|
| 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()
|
|
|
|
|
|