Spaces:
Sleeping
Sleeping
changed personality and max tokens
Browse files
app.py
CHANGED
|
@@ -7,14 +7,14 @@ client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
|
| 7 |
|
| 8 |
def respond(message, history):
|
| 9 |
|
| 10 |
-
messages = [{"role": "system", "content": "You are
|
| 11 |
# change the personality of the chatbot
|
| 12 |
if history:
|
| 13 |
messages.extend(history)
|
| 14 |
|
| 15 |
messages.append({"role" : "user", "content" : message})
|
| 16 |
|
| 17 |
-
response = client.chat_completion(messages, max_tokens =
|
| 18 |
# max tokens = change the length of the response
|
| 19 |
# temp = between 0-2
|
| 20 |
# top-p = between 0-1
|
|
|
|
| 7 |
|
| 8 |
def respond(message, history):
|
| 9 |
|
| 10 |
+
messages = [{"role": "system", "content": "You are extremely professional and smart."}]
|
| 11 |
# change the personality of the chatbot
|
| 12 |
if history:
|
| 13 |
messages.extend(history)
|
| 14 |
|
| 15 |
messages.append({"role" : "user", "content" : message})
|
| 16 |
|
| 17 |
+
response = client.chat_completion(messages, max_tokens = 50, temperature= .1, top_p= 0.7)
|
| 18 |
# max tokens = change the length of the response
|
| 19 |
# temp = between 0-2
|
| 20 |
# top-p = between 0-1
|