From 7de7a11aa98d1e0cea20e85b3d3f460341b94416 Mon Sep 17 00:00:00 2001 From: Wizerd Date: Wed, 17 Jan 2024 16:13:00 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E5=A4=8D=E4=BC=9A=E6=89=93?= =?UTF-8?q?=E5=B9=BF=E5=91=8A=E7=9A=84GPTS=E9=87=8D=E5=A4=8D=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E6=96=87=E5=AD=97=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index ea63470..e2d5215 100644 --- a/main.py +++ b/main.py @@ -197,9 +197,9 @@ CORS(app, resources={r"/images/*": {"origins": "*"}}) PANDORA_UPLOAD_URL = 'files.pandoranext.com' -VERSION = '0.5.2' +VERSION = '0.5.3' # VERSION = 'test' -UPDATE_INFO = '支持中断流式响应' +UPDATE_INFO = '修复会打广告的GPTS重复输出文字的bug' # UPDATE_INFO = '【仅供临时测试使用】 ' with app.app_context(): @@ -1138,7 +1138,8 @@ def data_fetcher(upstream_response, data_queue, stop_event, last_data_time, api_ parts = content.get("parts", []) full_text = ''.join(parts) new_text = full_text[len(last_full_text):] - last_full_text = full_text # 更新完整文本以备下次比较 + if full_text != '': + last_full_text = full_text # 更新完整文本以备下次比较 if "\u3010" in new_text and not citation_accumulating: citation_accumulating = True citation_buffer = citation_buffer + new_text