gpt_academic icon indicating copy to clipboard operation
gpt_academic copied to clipboard

多线程翻译pdf的编码bug

Open EmperorJia opened this issue 2 years ago • 1 comments

  • (1) Describe the bug 简述 将某些论文使用多线程翻译这个功能时,会出现文件写出错误的问题。目前是把toolbox.py里的 with open(f'./gpt_log/{file_name}', 'w', encoding='utf8') as f: 改为: with codecs.open('./gpt_log/{file_name}', 'w', encoding='utf-16', errors='ignore') as f: 可以解决

  • (2) Screen Shot 截图 image

  • (3) Terminal Traceback 终端traceback(如有)

  • (4) Material to Help Reproduce Bugs 帮助我们复现的测试材料样本(如有) 翻译的论文链接:https://arxiv.org/pdf/2211.00216

Before submitting an issue 提交issue之前:

  • Please try to upgrade your code. 如果您的代码不是最新的,建议您先尝试更新代码
  • Please check project wiki for common problem solutions.项目wiki有一些常见问题的解决方法

EmperorJia avatar Apr 29 '23 17:04 EmperorJia

我也遇到了这个问题。我把with open(f'./gpt_log/{file_name}', 'w', encoding='utf8') as f:改为了 with open(f'./gpt_log/{file_name}', 'w', encoding='utf8', errors='ignore') as f:,但是似乎改成utf16会更好。

huyang531 avatar Apr 30 '23 16:04 huyang531

找到问题了#773

binary-husky avatar May 22 '23 15:05 binary-husky