yangtb24 commited on
Commit
11c701f
·
verified ·
1 Parent(s): 5261088

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -453,7 +453,7 @@ def handsome_chat_completions():
453
  }
454
  ]
455
  }
456
- yield f"data: {json.dumps(message_data)}\n\n".encode("utf-8")
457
 
458
  for chunk in response.iter_content(chunk_size=2048):
459
  if chunk:
@@ -551,7 +551,8 @@ def handsome_chat_completions():
551
  response_content = response_json[
552
  "choices"
553
  ][0]["message"]["content"]
554
- response_content = "这是公益api,模型全部可用且保真,请不要对模型进行无意义的测试,请尽量不要使用高级模型解决没必要的问题。\n" + response_content
 
555
  except (KeyError, ValueError, IndexError) as e:
556
  logging.error(
557
  f"解析非流式响应 JSON 失败: {e}, "
 
453
  }
454
  ]
455
  }
456
+ # yield f"data: {json.dumps(message_data)}\n\n".encode("utf-8")
457
 
458
  for chunk in response.iter_content(chunk_size=2048):
459
  if chunk:
 
551
  response_content = response_json[
552
  "choices"
553
  ][0]["message"]["content"]
554
+ response_content = response_content
555
+ # response_content = "这是公益api,模型全部可用且保真,请不要对模型进行无意义的测试,请尽量不要使用高级模型解决没必要的问题。\n" + response_content
556
  except (KeyError, ValueError, IndexError) as e:
557
  logging.error(
558
  f"解析非流式响应 JSON 失败: {e}, "