Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,14 +6,14 @@ from huggingface_hub import InferenceClient
|
|
| 6 |
client = InferenceClient('Qwen/Qwen2.5-7B-Instruct-1M')
|
| 7 |
def respond(message, history):
|
| 8 |
|
| 9 |
-
messages = [{'role': 'system', 'content': 'You are a
|
| 10 |
|
| 11 |
if history:
|
| 12 |
messages.extend(history)
|
| 13 |
|
| 14 |
messages.append({"role": "user", "content": message})
|
| 15 |
|
| 16 |
-
response = client.chat_completion(messages, max_tokens =
|
| 17 |
|
| 18 |
return response["choices"][0]["message"]["content"].strip()
|
| 19 |
def echo(message, history):
|
|
|
|
| 6 |
client = InferenceClient('Qwen/Qwen2.5-7B-Instruct-1M')
|
| 7 |
def respond(message, history):
|
| 8 |
|
| 9 |
+
messages = [{'role': 'system', 'content': 'You are a friendly chatbot'}]
|
| 10 |
|
| 11 |
if history:
|
| 12 |
messages.extend(history)
|
| 13 |
|
| 14 |
messages.append({"role": "user", "content": message})
|
| 15 |
|
| 16 |
+
response = client.chat_completion(messages, max_tokens = 10)
|
| 17 |
|
| 18 |
return response["choices"][0]["message"]["content"].strip()
|
| 19 |
def echo(message, history):
|