Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,13 +8,17 @@ client=InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
|
| 8 |
def respond(message, history):
|
| 9 |
messages = [
|
| 10 |
{"role":"system",
|
| 11 |
-
"content": "You are a friendly chatbot! :)"
|
| 12 |
}
|
| 13 |
]
|
| 14 |
|
| 15 |
if history:
|
| 16 |
messages.extend(history)
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
response = client.chat_completion(messages, max_tokens=100)
|
| 19 |
|
| 20 |
chatbot = gr.ChatInterface(respond, type="messages")
|
|
|
|
| 8 |
def respond(message, history):
|
| 9 |
messages = [
|
| 10 |
{"role":"system",
|
| 11 |
+
"content": "You are a friendly chatbot! :)",
|
| 12 |
}
|
| 13 |
]
|
| 14 |
|
| 15 |
if history:
|
| 16 |
messages.extend(history)
|
| 17 |
|
| 18 |
+
messages.append(
|
| 19 |
+
{"role": "user",
|
| 20 |
+
"content": message})
|
| 21 |
+
|
| 22 |
response = client.chat_completion(messages, max_tokens=100)
|
| 23 |
|
| 24 |
chatbot = gr.ChatInterface(respond, type="messages")
|