Update app.py
Browse files
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", {})
|