Spaces:
Runtime error
Runtime error
减少每次处理的论文数
Browse files- crazy_functions/谷歌检索小助手.py +14 -13
crazy_functions/谷歌检索小助手.py
CHANGED
|
@@ -82,21 +82,22 @@ def 谷歌检索小助手(txt, llm_kwargs, plugin_kwargs, chatbot, history, syst
|
|
| 82 |
history = []
|
| 83 |
|
| 84 |
meta_paper_info_list = yield from get_meta_information(txt, chatbot, history)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
|
|
|
|
|
|
| 90 |
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
inputs=i_say, inputs_show_user=inputs_show_user,
|
| 94 |
-
llm_kwargs=llm_kwargs, chatbot=chatbot, history=[],
|
| 95 |
-
sys_prompt="你是一个学术翻译,请从数据中提取信息。你必须使用Markdown格式。你必须逐个文献进行处理。"
|
| 96 |
-
)
|
| 97 |
-
|
| 98 |
-
history.extend([ "第一批", gpt_say ])
|
| 99 |
-
meta_paper_info_list = meta_paper_info_list[10:]
|
| 100 |
|
| 101 |
chatbot.append(["状态?",
|
| 102 |
"已经全部完成,您可以试试让AI写一个Related Works,例如您可以继续输入Write a \"Related Works\" section about \"你搜索的研究领域\" for me."])
|
|
|
|
| 82 |
history = []
|
| 83 |
|
| 84 |
meta_paper_info_list = yield from get_meta_information(txt, chatbot, history)
|
| 85 |
+
batchsize = 7
|
| 86 |
+
for batch in range(len(meta_paper_info_list)//batchsize):
|
| 87 |
+
if len(meta_paper_info_list[:batchsize]) > 0:
|
| 88 |
+
i_say = "下面是一些学术文献的数据,提取出以下内容,使用Markdown格式输出:" + \
|
| 89 |
+
"1、英文题目;2、中文题目翻译;3、作者;4、arxiv公开(is_paper_in_arxiv);4、引用数量(cite);5、中文摘要翻译。" + \
|
| 90 |
+
f"以下是信息源:{str(meta_paper_info_list[:batchsize])}"
|
| 91 |
|
| 92 |
+
inputs_show_user = f"请分析此页面中出现的所有文章:{txt},这是第{batch+1}批"
|
| 93 |
+
gpt_say = yield from request_gpt_model_in_new_thread_with_ui_alive(
|
| 94 |
+
inputs=i_say, inputs_show_user=inputs_show_user,
|
| 95 |
+
llm_kwargs=llm_kwargs, chatbot=chatbot, history=[],
|
| 96 |
+
sys_prompt="你是一个学术翻译,请从数据中提取信息。你必须使用Markdown格式。你必须逐个文献进行处理。"
|
| 97 |
+
)
|
| 98 |
|
| 99 |
+
history.extend([ f"第{batch+1}批", gpt_say ])
|
| 100 |
+
meta_paper_info_list = meta_paper_info_list[batchsize:]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
|
| 102 |
chatbot.append(["状态?",
|
| 103 |
"已经全部完成,您可以试试让AI写一个Related Works,例如您可以继续输入Write a \"Related Works\" section about \"你搜索的研究领域\" for me."])
|