yangtb24 commited on
Commit
1d34c84
·
verified ·
1 Parent(s): 7f23627

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -664,8 +664,8 @@ def handsome_chat_completions():
664
  "index": 0,
665
  "message": {
666
  "role": "assistant",
667
- "content": None,
668
- "images": openai_images # This field should be named images instead of data or others
669
  },
670
  "finish_reason": "stop",
671
  }
@@ -687,7 +687,7 @@ def handsome_chat_completions():
687
  "index": 0,
688
  "message": {
689
  "role": "assistant",
690
- "content": None,
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
- # Existing text-based model handling logic
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(