瀏覽代碼

Update mineru/utils/llm_aided.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Xiaomeng Zhao 4 月之前
父節點
當前提交
3699949166
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      mineru/utils/llm_aided.py

+ 3 - 2
mineru/utils/llm_aided.py

@@ -87,10 +87,11 @@ Corrected title list:
                 temperature=0.7,
                 stream=True,
             )
-            content = ""
+            content_pieces = []
             for chunk in completion:
                 if chunk.choices:
-                    content += chunk.choices[0].delta.content
+                    content_pieces.append(chunk.choices[0].delta.content)
+            content = "".join(content_pieces)
             # logger.info(f"Title completion: {content}")
             if "</think>" in content:
                 idx = content.index("</think>") + len("</think>")