@@ -259,40 +259,25 @@ def Latex精细分解与转化(file_manifest, project_folder, llm_kwargs, plugin
259259 inputs_array , sys_prompt_array = switch_prompt (pfg , mode )
260260 inputs_show_user_array = [f"{ mode } { f } " for f in pfg .sp_file_tag ]
261261
262- if os .path .exists (pj (project_folder ,'temp.pkl' )):
263-
264- # <-------- 【仅调试】如果存在调试缓存文件,则跳过GPT请求环节 ---------->
265- pfg = objload (file = pj (project_folder ,'temp.pkl' ))
266-
267- else :
268- # <-------- gpt 多线程请求 ---------->
269- history_array = [["" ] for _ in range (n_split )]
270- # LATEX_EXPERIMENTAL, = get_conf('LATEX_EXPERIMENTAL')
271- # if LATEX_EXPERIMENTAL:
272- # paper_meta = f"The paper you processing is `{lps.title}`, a part of the abstraction is `{lps.abstract}`"
273- # paper_meta_max_len = 888
274- # history_array = [[ paper_meta[:paper_meta_max_len] + '...', "Understand, what should I do?"] for _ in range(n_split)]
275-
276- gpt_response_collection = yield from request_gpt_model_multi_threads_with_very_awesome_ui_and_high_efficiency (
277- inputs_array = inputs_array ,
278- inputs_show_user_array = inputs_show_user_array ,
279- llm_kwargs = llm_kwargs ,
280- chatbot = chatbot ,
281- history_array = history_array ,
282- sys_prompt_array = sys_prompt_array ,
283- # max_workers=5, # 并行任务数量限制, 最多同时执行5个, 其他的排队等待
284- scroller_max_len = 40
285- )
286-
287- # <-------- 文本碎片重组为完整的tex片段 ---------->
288- pfg .sp_file_result = []
289- for i_say , gpt_say , orig_content in zip (gpt_response_collection [0 ::2 ], gpt_response_collection [1 ::2 ], pfg .sp_file_contents ):
290- pfg .sp_file_result .append (gpt_say )
291- pfg .merge_result ()
292-
293- # <-------- 临时存储用于调试 ---------->
294- pfg .get_token_num = None
295- objdump (pfg , file = pj (project_folder ,'temp.pkl' ))
262+ # <-------- gpt 多线程请求 ---------->
263+ history_array = [["" ] for _ in range (n_split )]
264+
265+ gpt_response_collection = yield from request_gpt_model_multi_threads_with_very_awesome_ui_and_high_efficiency (
266+ inputs_array = inputs_array ,
267+ inputs_show_user_array = inputs_show_user_array ,
268+ llm_kwargs = llm_kwargs ,
269+ chatbot = chatbot ,
270+ history_array = history_array ,
271+ sys_prompt_array = sys_prompt_array ,
272+ # max_workers=5, # 并行任务数量限制, 最多同时执行5个, 其他的排队等待
273+ scroller_max_len = 40
274+ )
275+
276+ # <-------- 文本碎片重组为完整的tex片段 ---------->
277+ pfg .sp_file_result = []
278+ for i_say , gpt_say , orig_content in zip (gpt_response_collection [0 ::2 ], gpt_response_collection [1 ::2 ], pfg .sp_file_contents ):
279+ pfg .sp_file_result .append (gpt_say )
280+ pfg .merge_result ()
296281
297282 write_html (pfg .sp_file_contents , pfg .sp_file_result , chatbot = chatbot , project_folder = project_folder )
298283
0 commit comments