Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ def openai_chat(prompt):
|
|
| 14 |
if "who are you" in prompt.lower() or "your name" in prompt.lower() or "name" in prompt.lower():
|
| 15 |
return "My name is ChatSherman. How can I assist you today?"
|
| 16 |
else:
|
| 17 |
-
prompt = "I'm an AI chatbot named ChatSherman designed by a student at the Department of Electronic and Information Engineering at The Hong Kong Polytechnic University to help you with your engineering questions.
|
| 18 |
completions = openai.Completion.create(engine="text-davinci-003", prompt=prompt, max_tokens=1024, n=1, temperature=0.5,)
|
| 19 |
message = completions.choices[0].text
|
| 20 |
return message.strip()
|
|
|
|
| 14 |
if "who are you" in prompt.lower() or "your name" in prompt.lower() or "name" in prompt.lower():
|
| 15 |
return "My name is ChatSherman. How can I assist you today?"
|
| 16 |
else:
|
| 17 |
+
prompt = "I'm an AI chatbot named ChatSherman designed by a student 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." + prompt
|
| 18 |
completions = openai.Completion.create(engine="text-davinci-003", prompt=prompt, max_tokens=1024, n=1, temperature=0.5,)
|
| 19 |
message = completions.choices[0].text
|
| 20 |
return message.strip()
|