Ver Fonte

Update mineru/utils/llm_aided.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Xiaomeng Zhao há 4 meses atrás
pai
commit
3699949166
1 ficheiros alterados com 3 adições e 2 exclusões
  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>")