ValueFX9507 commited on
Commit
0e0b334
·
verified ·
1 Parent(s): b6f2df7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -112,7 +112,7 @@ def predict(message, chat_history, system_msg, temperature, top_p, repetition_pe
112
  # 流式处理
113
  for chunk in response.iter_lines():
114
  if chunk:
115
- chunk_str = chunk.decode("utf-8").:
116
  chunk_data = json.loads(chunk_str)
117
  if "choices" in chunk_data:
118
  delta = chunk_data["choices"][0].get("delta", {})
 
112
  # 流式处理
113
  for chunk in response.iter_lines():
114
  if chunk:
115
+ chunk_str = chunk.decode("utf-8").replace("data: ", "")
116
  chunk_data = json.loads(chunk_str)
117
  if "choices" in chunk_data:
118
  delta = chunk_data["choices"][0].get("delta", {})