Procházet zdrojové kódy

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

黄泳凯 před 5 měsíci
rodič
revize
cbc14bfe1d
1 změnil soubory, kde provedl 5 přidání a 1 odebrání
  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>")