gpt_academic icon indicating copy to clipboard operation
gpt_academic copied to clipboard

[Feature]: 请问能批量翻译多个本地PDF文件吗

Open daoyeshan opened this issue 1 year ago • 17 comments

Class | 类型

其他

Feature Request | 功能请求

现在貌似一次只能翻译一篇本地PDF文章,请问可以加入一次性翻译多篇本地PDF文章的功能吗?

daoyeshan avatar Aug 30 '23 10:08 daoyeshan

支持呀,打包zip拖进去

binary-husky avatar Aug 31 '23 03:08 binary-husky

哦哦,之前用了几次zip文件,每次都出错,我还以为是这个功能有问题呢 谢谢了

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2023年08月31日 11:24 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [binary-husky/gpt_academic] [Feature]: 请问能批量翻译多个本地PDF文件吗 (Issue #1076) |

支持呀,打包zip拖进去

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

daoyeshan avatar Aug 31 '23 03:08 daoyeshan

如果再遇到有什么错误可以截图保留一下

binary-husky avatar Aug 31 '23 03:08 binary-husky

好的,谢谢

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2023年08月31日 11:35 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [binary-husky/gpt_academic] [Feature]: 请问能批量翻译多个本地PDF文件吗 (Issue #1076) |

如果再遇到有什么错误可以截图保留一下

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

daoyeshan avatar Sep 01 '23 04:09 daoyeshan

现在使用的时候发现两个问题: 1、执行多线程的时候,出现“openai绑定信用卡可解除限制频率限制”,请问这个是什么情况?是因为线程开多了受到openai的限制吗? 2、压缩多个本地PDF文件进行英译中时,只完成了前几个PDF文件,其后的PDF文件出现翻译失败,这个PDF后半部分的多线程基本上显示“已失败”。请问这是网络原因,还是其他什么原因啊

代码如下: [Local Message] 实验性函数调用出错: Traceback (most recent call last): File "./toolbox.py", line 122, in decorated yield from f(main_input, llm_kwargs, plugin_kwargs, chatbot_with_cookie, history, *args, **kwargs) File "./crazy_functions/批量翻译PDF文档_多线程.py", line 53, in 批量翻译PDF文档 yield from 解析PDF_基于GROBID(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, grobid_url) File "./crazy_functions/批量翻译PDF文档_多线程.py", line 72, in 解析PDF_基于GROBID title = article_dict.get('title', '无法获取 title'); prompt += f'title:{title}\n\n' AttributeError: 'NoneType' object has no attribute 'get' 当前代理可用性:

代理配置 无, 代理所在地:United States - Amazon.com, Inc.

daoyeshan avatar Sep 01 '23 12:09 daoyeshan

我又重新测试了一下,也是在翻译了四五篇PDF以后出现以下错误。我用的是GPT3.5的key: [Local Message] 警告,在执行过程中遭遇问题, Traceback: Traceback (most recent call last): File ".\crazy_functions\crazy_utils.py", line 79, in _req_gpt result = predict_no_ui_long_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".\request_llm\bridge_all.py", line 457, in predict_no_ui_long_connection return method(inputs, llm_kwargs, history, sys_prompt, observe_window, console_slience) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".\request_llm\bridge_chatgpt.py", line 87, in predict_no_ui_long_connection raise RuntimeError("OpenAI拒绝了请求:" + error_msg) RuntimeError: OpenAI拒绝了请求:{ "error": { "message": "Rate limit reached for default-gpt-3.5-turbo in organization org-wzmv8Fit8jMQifP22YNaweRc on requests per day. Limit: 200 / day. Please try again in 7m12s. Contact us through our help center at help.openai.com if you continue to have issues. Please add a payment method to your account to increase your rate limit. Visit https://platform.openai.com/account/billing to add a payment method.", "type": "requests", "param": null, "code": "rate_limit_exceeded" }}

daoyeshan avatar Sep 01 '23 14:09 daoyeshan

现在使用的时候发现两个问题: 1、执行多线程的时候,出现“openai绑定信用卡可解除限制频率限制”,请问这个是什么情况?是因为线程开多了受到openai的限制吗? 2、压缩多个本地PDF文件进行英译中时,只完成了前几个PDF文件,其后的PDF文件出现翻译失败,这个PDF后半部分的多线程基本上显示“已失败”。请问这是网络原因,还是其他什么原因啊

代码如下: [Local Message] 实验性函数调用出错: Traceback (most recent call last): File "./toolbox.py", line 122, in decorated yield from f(main_input, llm_kwargs, plugin_kwargs, chatbot_with_cookie, history, *args, **kwargs) File "./crazy_functions/批量翻译PDF文档_多线程.py", line 53, in 批量翻译PDF文档 yield from 解析PDF_基于GROBID(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, grobid_url) File "./crazy_functions/批量翻译PDF文档_多线程.py", line 72, in 解析PDF_基于GROBID title = article_dict.get('title', '无法获取 title'); prompt += f'title:{title}\n\n' AttributeError: 'NoneType' object has no attribute 'get' 当前代理可用性:

代理配置 无, 代理所在地:United States - Amazon.com, Inc.

看起来是有一篇PDF解析失败了,能提供下样本吗

binary-husky avatar Sep 02 '23 11:09 binary-husky

我又重新测试了一下,也是在翻译了四五篇PDF以后出现以下错误。我用的是GPT3.5的key: [Local Message] 警告,在执行过程中遭遇问题, Traceback: Traceback (most recent call last): File ".\crazy_functions\crazy_utils.py", line 79, in _req_gpt result = predict_no_ui_long_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".\request_llm\bridge_all.py", line 457, in predict_no_ui_long_connection return method(inputs, llm_kwargs, history, sys_prompt, observe_window, console_slience) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".\request_llm\bridge_chatgpt.py", line 87, in predict_no_ui_long_connection raise RuntimeError("OpenAI拒绝了请求:" + error_msg) RuntimeError: OpenAI拒绝了请求:{ "error": { "message": "Rate limit reached for default-gpt-3.5-turbo in organization org-wzmv8Fit8jMQifP22YNaweRc on requests per day. Limit: 200 / day. Please try again in 7m12s. Contact us through our help center at help.openai.com if you continue to have issues. Please add a payment method to your account to increase your rate limit. Visit https://platform.openai.com/account/billing to add a payment method.", "type": "requests", "param": null, "code": "rate_limit_exceeded" }}

这个报错已经很清晰了,买个高质量的api key,或者减小 DEFAULT_WORKER_NUM

binary-husky avatar Sep 02 '23 11:09 binary-husky

我用的是自己在官网注册的账号,注册的菲律宾的账号。请问你说的高质量key是啥意思?是跟地区的账号有关吗?我是文科生,对代码相关的知识不太懂 谢谢!

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2023年09月02日 19:50 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [binary-husky/gpt_academic] [Feature]: 请问能批量翻译多个本地PDF文件吗 (Issue #1076) |

我又重新测试了一下,也是在翻译了四五篇PDF以后出现以下错误。我用的是GPT3.5的key: [Local Message] 警告,在执行过程中遭遇问题, Traceback: Traceback (most recent call last): File ".\crazy_functions\crazy_utils.py", line 79, in _req_gpt result = predict_no_ui_long_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".\request_llm\bridge_all.py", line 457, in predict_no_ui_long_connection return method(inputs, llm_kwargs, history, sys_prompt, observe_window, console_slience) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".\request_llm\bridge_chatgpt.py", line 87, in predict_no_ui_long_connection raise RuntimeError("OpenAI拒绝了请求:" + error_msg) RuntimeError: OpenAI拒绝了请求:{ "error": { "message": "Rate limit reached for default-gpt-3.5-turbo in organization org-wzmv8Fit8jMQifP22YNaweRc on requests per day. Limit: 200 / day. Please try again in 7m12s. Contact us through our help center at help.openai.com if you continue to have issues. Please add a payment method to your account to increase your rate limit. Visit https://platform.openai.com/account/billing to add a payment method.", "type": "requests", "param": null, "code": "rate_limit_exceeded" }}

这个报错已经很清晰了,买个高质量的api key,或者减小 DEFAULT_WORKER_NUM

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

daoyeshan avatar Sep 07 '23 02:09 daoyeshan

另外,我也使用了GPT学术优化的网页版,发现在同样网络下,网页版不挂梯子也能使用。但是不论挂不挂梯子,翻译论文时,多线程更容易出现失败的情况,请问这是什么原因导致的? 另外,使用网页版时,似乎不能同时用同一个key运行多个网页,这是受openai的限制,还是网页版的问题呢? 谢谢解答

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2023年09月03日 16:28 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [binary-husky/gpt_academic] [Feature]: 请问能批量翻译多个本地PDF文件吗 (Issue #1076) |

Reopened #1076.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

daoyeshan avatar Sep 07 '23 02:09 daoyeshan

openai的限制

binary-husky avatar Sep 08 '23 12:09 binary-husky

我用的是自己在官网注册的账号,注册的菲律宾的账号。请问你说的高质量key是啥意思?是跟地区的账号有关吗?我是文科生,对代码相关的知识不太懂 谢谢! ---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2023年09月02日 19:50 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [binary-husky/gpt_academic] [Feature]: 请问能批量翻译多个本地PDF文件吗 (Issue #1076) | 我又重新测试了一下,也是在翻译了四五篇PDF以后出现以下错误。我用的是GPT3.5的key: [Local Message] 警告,在执行过程中遭遇问题, Traceback: Traceback (most recent call last): File ".\crazy_functions\crazy_utils.py", line 79, in _req_gpt result = predict_no_ui_long_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".\request_llm\bridge_all.py", line 457, in predict_no_ui_long_connection return method(inputs, llm_kwargs, history, sys_prompt, observe_window, console_slience) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".\request_llm\bridge_chatgpt.py", line 87, in predict_no_ui_long_connection raise RuntimeError("OpenAI拒绝了请求:" + error_msg) RuntimeError: OpenAI拒绝了请求:{ "error": { "message": "Rate limit reached for default-gpt-3.5-turbo in organization org-wzmv8Fit8jMQifP22YNaweRc on requests per day. Limit: 200 / day. Please try again in 7m12s. Contact us through our help center at help.openai.com if you continue to have issues. Please add a payment method to your account to increase your rate limit. Visit https://platform.openai.com/account/billing to add a payment method.", "type": "requests", "param": null, "code": "rate_limit_exceeded" }} 这个报错已经很清晰了,买个高质量的api key,或者减小 DEFAULT_WORKER_NUM — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

可以买国内第三方代理的服务,网上一搜一堆

OpenAI-SB API2D OhMyGPT AI Proxy CloseAI

binary-husky avatar Sep 08 '23 12:09 binary-husky

好的,谢谢

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2023年09月08日 20:30 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [binary-husky/gpt_academic] [Feature]: 请问能批量翻译多个本地PDF文件吗 (Issue #1076) |

我用的是自己在官网注册的账号,注册的菲律宾的账号。请问你说的高质量key是啥意思?是跟地区的账号有关吗?我是文科生,对代码相关的知识不太懂 谢谢! … ---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2023年09月02日 19:50 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [binary-husky/gpt_academic] [Feature]: 请问能批量翻译多个本地PDF文件吗 (Issue #1076) | 我又重新测试了一下,也是在翻译了四五篇PDF以后出现以下错误。我用的是GPT3.5的key: [Local Message] 警告,在执行过程中遭遇问题, Traceback: Traceback (most recent call last): File ".\crazy_functions\crazy_utils.py", line 79, in _req_gpt result = predict_no_ui_long_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".\request_llm\bridge_all.py", line 457, in predict_no_ui_long_connection return method(inputs, llm_kwargs, history, sys_prompt, observe_window, console_slience) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".\request_llm\bridge_chatgpt.py", line 87, in predict_no_ui_long_connection raise RuntimeError("OpenAI拒绝了请求:" + error_msg) RuntimeError: OpenAI拒绝了请求:{ "error": { "message": "Rate limit reached for default-gpt-3.5-turbo in organization org-wzmv8Fit8jMQifP22YNaweRc on requests per day. Limit: 200 / day. Please try again in 7m12s. Contact us through our help center at help.openai.com if you continue to have issues. Please add a payment method to your account to increase your rate limit. Visit https://platform.openai.com/account/billing to add a payment method.", "type": "requests", "param": null, "code": "rate_limit_exceeded" }} 这个报错已经很清晰了,买个高质量的api key,或者减小 DEFAULT_WORKER_NUM — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

可以买国内第三方代理的服务,网上一搜一堆

OpenAI-SB API2D OhMyGPT AI Proxy CloseAI

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

daoyeshan avatar Sep 08 '23 12:09 daoyeshan

现在使用的时候发现两个问题: 1、执行多线程的时候,出现“openai绑定信用卡可解除限制频率限制”,请问这个是什么情况?是因为线程开多了受到openai的限制吗? 2、压缩多个本地PDF文件进行英译中时,只完成了前几个PDF文件,其后的PDF文件出现翻译失败,这个PDF后半部分的多线程基本上显示“已失败”。请问这是网络原因,还是其他什么原因啊

代码如下: [Local Message] 实验性函数调用出错: Traceback (most recent call last): File "./toolbox.py", line 122, in decorated yield from f(main_input, llm_kwargs, plugin_kwargs, chatbot_with_cookie, history, *args, **kwargs) File "./crazy_functions/批量翻译PDF文档_多线程.py", line 53, in 批量翻译PDF文档 yield from 解析PDF_基于GROBID(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, grobid_url) File "./crazy_functions/批量翻译PDF文档_多线程.py", line 72, in 解析PDF_基于GROBID title = article_dict.get('title', '无法获取 title'); prompt += f'title:{title}\n\n' AttributeError: 'NoneType' object has no attribute 'get' 当前代理可用性:

代理配置 无, 代理所在地:United States - Amazon.com, Inc.

今天发现这个是grobid解析失败导致的bug,之后会修复

binary-husky avatar Sep 08 '23 12:09 binary-husky

哦,这样呀,拭目以待

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2023年09月08日 20:51 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [binary-husky/gpt_academic] [Feature]: 请问能批量翻译多个本地PDF文件吗 (Issue #1076) |

现在使用的时候发现两个问题: 1、执行多线程的时候,出现“openai绑定信用卡可解除限制频率限制”,请问这个是什么情况?是因为线程开多了受到openai的限制吗? 2、压缩多个本地PDF文件进行英译中时,只完成了前几个PDF文件,其后的PDF文件出现翻译失败,这个PDF后半部分的多线程基本上显示“已失败”。请问这是网络原因,还是其他什么原因啊

代码如下: [Local Message] 实验性函数调用出错: Traceback (most recent call last): File "./toolbox.py", line 122, in decorated yield from f(main_input, llm_kwargs, plugin_kwargs, chatbot_with_cookie, history, *args, **kwargs) File "./crazy_functions/批量翻译PDF文档_多线程.py", line 53, in 批量翻译PDF文档 yield from 解析PDF_基于GROBID(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, grobid_url) File "./crazy_functions/批量翻译PDF文档_多线程.py", line 72, in 解析PDF_基于GROBID title = article_dict.get('title', '无法获取 title'); prompt += f'title:{title}\n\n' AttributeError: 'NoneType' object has no attribute 'get' 当前代理可用性:

代理配置 无, 代理所在地:United States - Amazon.com, Inc.

今天发现这个是grobid解析失败导致的bug,之后会修复

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

daoyeshan avatar Sep 08 '23 13:09 daoyeshan

大佬,我想问我在翻译的时候能不能将三线程改成更多线程,我组了个key池,应该带得动

Xu-Jam avatar Dec 05 '23 11:12 Xu-Jam

@binary-husky closeai的api有一个API base,这个在config_private.py中哪里设置呢?只设定api-key一直提示incorrect api key

poincarelee avatar Dec 07 '23 11:12 poincarelee