大模型响应的内容为None,源码报错,但是代码不停止运行
before ...
- [x] This issue is not about question or bug.
Add a description
图片中控制台红色的错误是源码打印的,白色的是我自己加的两行代码
用的azure-openai服务,模型gpt-4o,由于文中有翻译内容触发了大模型过滤,所以响应的response.choices[0].message.content为None, 导致源码return response.choices[0].message.content.strip()这行代码一直报错:'NoneType' object has no attribute 'strip'
但是即使报错了,还一直在执行,一直不停止,而且还没办法捕获到错误,请问这个要怎么处理,我要怎样能在代码刚报错的时候,就停止运行捕获到错误,从而更新我的文件翻译状态
1.x的代码准备弃用了。如果想研究代码的话,可以考虑直接看2.0的实现。
1.x的代码准备弃用了。如果想研究代码的话,可以考虑直接看2.0的实现。
请问怎样可以用pip安装到2.0的版本,我现在pip安装只能安装到pdf2zh==1.9.9
因为2.0还是preview,所以还不太能pipinstall。但是可以源码安装。 2.0的地址在置顶issue中。
#965 等吧
v2.0 issue: https://github.com/Byaidu/PDFMathTranslate/issues/586#issuecomment-2939597926
move to:https://github.com/PDFMathTranslate/PDFMathTranslate-next?tab=readme-ov-file
我没有安装2.0,但我找到一个解决办法,https://github.com/Byaidu/PDFMathTranslate/issues/1055