Update app.py
Browse files
app.py
CHANGED
|
@@ -664,8 +664,8 @@ def handsome_chat_completions():
|
|
| 664 |
"index": 0,
|
| 665 |
"message": {
|
| 666 |
"role": "assistant",
|
| 667 |
-
|
| 668 |
-
"images": openai_images
|
| 669 |
},
|
| 670 |
"finish_reason": "stop",
|
| 671 |
}
|
|
@@ -687,7 +687,7 @@ def handsome_chat_completions():
|
|
| 687 |
"index": 0,
|
| 688 |
"message": {
|
| 689 |
"role": "assistant",
|
| 690 |
-
"content":
|
| 691 |
"images": []
|
| 692 |
},
|
| 693 |
"finish_reason": "stop",
|
|
@@ -710,7 +710,7 @@ def handsome_chat_completions():
|
|
| 710 |
logging.error(f"请求转发异常: {e}")
|
| 711 |
return jsonify({"error": str(e)}), 500
|
| 712 |
else:
|
| 713 |
-
|
| 714 |
try:
|
| 715 |
start_time = time.time()
|
| 716 |
response = requests.post(
|
|
|
|
| 664 |
"index": 0,
|
| 665 |
"message": {
|
| 666 |
"role": "assistant",
|
| 667 |
+
"content": "Generated Image:", # Changed content here
|
| 668 |
+
"images": openai_images
|
| 669 |
},
|
| 670 |
"finish_reason": "stop",
|
| 671 |
}
|
|
|
|
| 687 |
"index": 0,
|
| 688 |
"message": {
|
| 689 |
"role": "assistant",
|
| 690 |
+
"content": "Error Generating Image:", # Changed content here
|
| 691 |
"images": []
|
| 692 |
},
|
| 693 |
"finish_reason": "stop",
|
|
|
|
| 710 |
logging.error(f"请求转发异常: {e}")
|
| 711 |
return jsonify({"error": str(e)}), 500
|
| 712 |
else:
|
| 713 |
+
# Existing text-based model handling logic
|
| 714 |
try:
|
| 715 |
start_time = time.time()
|
| 716 |
response = requests.post(
|