Unverified Commit 36999491 authored by Xiaomeng Zhao's avatar Xiaomeng Zhao Committed by GitHub
Browse files

Update mineru/utils/llm_aided.py


Co-authored-by: default avatarCopilot <175728472+Copilot@users.noreply.github.com>
parent 4b8eb31a
...@@ -87,10 +87,11 @@ Corrected title list: ...@@ -87,10 +87,11 @@ Corrected title list:
temperature=0.7, temperature=0.7,
stream=True, stream=True,
) )
content = "" content_pieces = []
for chunk in completion: for chunk in completion:
if chunk.choices: 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}") # logger.info(f"Title completion: {content}")
if "</think>" in content: if "</think>" in content:
idx = content.index("</think>") + len("</think>") idx = content.index("</think>") + len("</think>")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment