Spaces:
Sleeping
Sleeping
comment some questions
Browse files
app.py
CHANGED
|
@@ -3,15 +3,17 @@ import random
|
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
| 5 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
|
|
|
| 6 |
|
| 7 |
def respond(message, history):
|
| 8 |
-
messages = [{"role": "system", "content": "You are a friendly chatbot."}]
|
| 9 |
if history:
|
| 10 |
messages.extend(history)
|
| 11 |
|
| 12 |
messages.append({"role": "user", "content": message})
|
| 13 |
|
| 14 |
response = client.chat_completion(messages, max_tokens = 100)
|
|
|
|
| 15 |
|
| 16 |
print(response['choices'][0]['message']['content'].strip())
|
| 17 |
|
|
|
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
| 5 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 6 |
+
#Changes the LLM being used
|
| 7 |
|
| 8 |
def respond(message, history):
|
| 9 |
+
messages = [{"role": "system", "content": "You are a friendly chatbot."}] #Change the personaliy of the chatbot
|
| 10 |
if history:
|
| 11 |
messages.extend(history)
|
| 12 |
|
| 13 |
messages.append({"role": "user", "content": message})
|
| 14 |
|
| 15 |
response = client.chat_completion(messages, max_tokens = 100)
|
| 16 |
+
# Changes the length of message
|
| 17 |
|
| 18 |
print(response['choices'][0]['message']['content'].strip())
|
| 19 |
|