Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -86,7 +86,12 @@ def respond(message, history):
|
|
| 86 |
|
| 87 |
# Send the conversation to the Mistral model via Hugging Face
|
| 88 |
# max_tokens=300 limits how long the reply can be
|
|
|
|
| 89 |
response = client.chat_completion(messages, max_tokens=300)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
# Extract the first reply from the model's response
|
| 92 |
bot_reply = response.choices[0].message.content
|
|
|
|
| 86 |
|
| 87 |
# Send the conversation to the Mistral model via Hugging Face
|
| 88 |
# max_tokens=300 limits how long the reply can be
|
| 89 |
+
try:
|
| 90 |
response = client.chat_completion(messages, max_tokens=300)
|
| 91 |
+
print(response)
|
| 92 |
+
except Exception as e:
|
| 93 |
+
print("ERROR:", e)
|
| 94 |
+
|
| 95 |
|
| 96 |
# Extract the first reply from the model's response
|
| 97 |
bot_reply = response.choices[0].message.content
|