فهرست منبع

Fix:Error code:500,param:Request timed out, please try again later.

黄泳凯 5 ماه پیش
والد
کامیت
cbc14bfe1d
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      mineru/utils/llm_aided.py

+ 5 - 1
mineru/utils/llm_aided.py

@@ -85,8 +85,12 @@ Corrected title list:
                 messages=[
                     {'role': 'user', 'content': title_optimize_prompt}],
                 temperature=0.7,
+                stream=True,
             )
-            content = completion.choices[0].message.content.strip()
+            content = ""
+            for chunk in completion:
+                if chunk.choices:
+                    content += chunk.choices[0].delta.content
             # logger.info(f"Title completion: {content}")
             if "</think>" in content:
                 idx = content.index("</think>") + len("</think>")