Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,14 +8,12 @@ def respond(message, history):
|
|
| 8 |
#responses = ["Yes", "No"]
|
| 9 |
#return random.choice(responses)
|
| 10 |
|
| 11 |
-
messages = [
|
| 12 |
-
{"role":"system",
|
| 13 |
-
"content":"You are a friendly chatbot :)"
|
| 14 |
-
}
|
| 15 |
-
]
|
| 16 |
|
| 17 |
if history:
|
| 18 |
messages.extend(history)
|
|
|
|
|
|
|
| 19 |
|
| 20 |
response = client.chat_completion(messages, max_tokens=100, temperature=1.3, top_p=0.2)
|
| 21 |
# temperature and top_p control randomness
|
|
|
|
| 8 |
#responses = ["Yes", "No"]
|
| 9 |
#return random.choice(responses)
|
| 10 |
|
| 11 |
+
messages = [{"role":"system", "content":"You are a friendly chatbot :)"}]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
if history:
|
| 14 |
messages.extend(history)
|
| 15 |
+
|
| 16 |
+
messages.append({"role":"user", "content":message})
|
| 17 |
|
| 18 |
response = client.chat_completion(messages, max_tokens=100, temperature=1.3, top_p=0.2)
|
| 19 |
# temperature and top_p control randomness
|