We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
- OS:windows - Python:3.12 - pdf2zh:1.9.2
使用下面config在批量执行下无法正常调用openai,选了默认 的谷歌翻译
File: config.json
{ "USE_MODELSCOPE": "0", "PDF2ZH_LANG_FROM": "English", "PDF2ZH_LANG_TO": "Simplified Chinese", "NOTO_FONT_PATH": "/app/SourceHanSerifCN-Regular.ttf", "translators": [ { "name": "openai", "envs": { "OPENAI_BASE_URL": "https://ark.cn-beijing.volces.com/api/v3", "OPENAI_API_KEY": "***", "OPENAI_MODEL": "doubao-1-5-lite-32k-250115" } } ] }
在目录保存./config.json后 执行
./pdf2zh.exe --dir 文件夹 --config ./config.json
正常调用openai接口而不是谷歌翻译
(main) PS D:\Program_Green\pdf翻译> ls Directory: D:\Program_Green\pdf翻译 Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 2025/2/25 22:42 .gradio d---- 2025/2/25 23:02 pdf2zh_files d---- 2025/2/25 22:40 runtime d---- 2025/2/25 22:42 site-packages -a--- 2025/2/23 4:05 157 _pystand_static.int -a--- 2025/2/25 23:09 87 cmd.txt -a--- 2025/2/25 23:08 450 config.json -a--- 2025/2/23 4:05 149504 pdf2zh.exe (main) PS D:\Program_Green\pdf翻译> ./pdf2zh.exe --dir D:/BaiduSyncdisk/大三下/编译原理/ppt --config ./config.json argos-translate is not installed, argostranslate will not work. if you want to use argostranslate, please install it. Namespace(files=['D:/BaiduSyncdisk/大三下/编译原理/ppt'], debug=False, pages=None, vfont='', vchar='', lang_in='en', lang_out='zh', service='google', output='', thread=4, interactive=False, share=False, flask=False, celery=False, authorized=None, prompt=None, compatible=False, onnx=None, serverport=None, dir=True, config='./config.json', babeldoc=False) 0%| | 0/44 [00:00<?, ?it/s]ERROR:pdf2zh.converter:HTTPSConnectionPool(host='translate.google.com', port=443): Max retries exceeded with url: /m?tl=zh-CN&sl=en&q=School+of+Computer+Science+and+Engineering+lnslwj%40mail.sysu.edu.cn (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x00000244A212D880>, 'Connection to translate.google.com timed out. (connect timeout=None)')) ERROR:pdf2zh.converter:HTTPSConnectionPool(host='translate.google.com', port=443): Max retries exceeded with url: /m?tl=zh-CN&sl=en&q=Prof.+Wen-jun+LI (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x00000244A212C5F0>, 'Connection to translate.google.com timed out. (connect timeout=None)')) ERROR:pdf2zh.converter:HTTPSConnectionPool(host='translate.google.com', port=443): Max retries exceeded with url: /m?tl=zh-CN&sl=en&q=Principles+of++Compiler+Construction (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x00000244A212D070>, 'Connection to translate.google.com timed out. (connect timeout=None)'))
No response
The text was updated successfully, but these errors were encountered:
在网页版配置接口后 ./pdf2zh.exe --dir D:/BaiduSyncdisk/大三下/编译原理/ppt -s openai:doubao-1-5-lite-32k-250115 就可以 也许是我要用-s在后面
Sorry, something went wrong.
根据问题描述来看,./config.json第一次没有读入。 我需要测试一下尝试复习问题,如有进展会在这个issue中更新。
No branches or pull requests
在提问之前...
使用的环境
描述你的问题
使用下面config在批量执行下无法正常调用openai,选了默认 的谷歌翻译
File: config.json
如何复现
在目录保存./config.json后
执行
预期行为
正常调用openai接口而不是谷歌翻译
相关 Logs
原始PDF文件
No response
还有别的吗?
No response
The text was updated successfully, but these errors were encountered: