Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -636,12 +636,15 @@ def classify(platform, UserInput, Images, Textbox2, Textbox3):
|
|
| 636 |
"Authorization": f"Bearer {auth}"
|
| 637 |
}
|
| 638 |
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
|
|
|
|
|
|
|
|
|
| 645 |
output.append({"Mode": "Chat", "content": reply})
|
| 646 |
|
| 647 |
return output
|
|
|
|
| 636 |
"Authorization": f"Bearer {auth}"
|
| 637 |
}
|
| 638 |
|
| 639 |
+
try:
|
| 640 |
+
response = requests.post(host, headers=headers, json={
|
| 641 |
+
"messages": messages,
|
| 642 |
+
"model": model_llm
|
| 643 |
+
}).json()
|
| 644 |
+
|
| 645 |
+
reply = response["choices"][0]["message"]["content"]
|
| 646 |
+
except:
|
| 647 |
+
reply = "Maximum messages: 15. Please clear your history and Try Again!"
|
| 648 |
output.append({"Mode": "Chat", "content": reply})
|
| 649 |
|
| 650 |
return output
|