-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
问题描述
使用其他翻译服务时在powershell或者cmd都定义了变量
cmd:
set OPENAILIKE_BASE_URL = https://api.***
set OPENAILIKE_API_KEY = sk-***
set OPENAILIKE_MODEL = de***
powershell:
$env:OPENAILIKE_BASE_URL = 'https://api.'
$env:OPENAILIKE_API_KEY = 'sk-'
$env:OPENAILIKE_MODEL = 'de*'
在pdf目录下使用pdf2zh aaa.pdf -s openai-liked 或者指定其他翻译服务都会报错,bing不会,不知道是我电脑的问题还是哪里配置/参数有问题?
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "D:\soft\Python312\Scripts\pdf2zh.exe_main.py", line 7, in
File "D:\soft\Python312\Lib\site-packages\pdf2zh\pdf2zh.py", line 164, in main
translate(**vars(parsed_args))
File "D:\soft\Python312\Lib\site-packages\pdf2zh\high_level.py", line 278, in translate
s_mono, s_dual = translate_stream(s_raw, **locals())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\soft\Python312\Lib\site-packages\pdf2zh\high_level.py", line 213, in translate_stream
obj_patch: dict = translate_patch(fp, **locals())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\soft\Python312\Lib\site-packages\pdf2zh\high_level.py", line 91, in translate_patch
device = TranslateConverter(
^^^^^^^^^^^^^^^^^^^
File "D:\soft\Python312\Lib\site-packages\pdf2zh\converter.py", line 150, in init
raise ValueError("Unsupported translation service")
ValueError: Unsupported translation service