Git Product home page Git Product logo

easytrans-mac's People

Contributors

chenqiny avatar ding-kyoma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

easytrans-mac's Issues

API报错:PARAM_FROM_TO_OR_Q_EMPTY

大佬,翻译过程中提示这个,然后就翻译不下去了,我看API文档说是参数里必填字段有空值,这个怎么办啊?

********** ERROR **********
content:
error_code: 54000
error_msg: PARAM_FROM_TO_OR_Q_EMPTY
******** Try Again(10) ********

翻译报错,输出空白内容,JSONDecodeError

电脑:MacBook pro m3
系统:macOs 14
环境:conda(新建了环境,按照教程走的,也安装了两个arm架构的两行指令)
翻译api:有道,更改了account.py and main.py
结果:output文件夹,输出了空白的几个文件

报错内容:

python main.py
当前翻译的pdf名字 2201.01416.pdf
                                                                                          
==================================== 正在翻译第1页 ====================================
Latent Vector Expansion using Autoencoder for Anomaly Detection                           
2201.01416.pdf:   0%|                                               | 0/3 [00:00<?, ?it/s]
翻译过程出现异常......
Traceback (most recent call last):
  File "/Users/xxx/Downloads/tmp/EasyTrans-mac/main.py", line 234, in main
    res = net_translate(trans_pragraph).replace(' ', '')
  File "/Users/xxx/Downloads/tmp/EasyTrans-mac/translate_func.py", line 109, in youdao_translate
    ta = json.loads(html)
  File "/Users/xxx/anaconda3/envs/trans/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/Users/xxx/anaconda3/envs/trans/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Users/xxx/anaconda3/envs/trans/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
/Users/xxx/Downloads/tmp/EasyTrans-mac/output_file/2201.01416_translated.pdf
Total translation time: 0.160043 sec
 
保存txt成功
保存txt成功
保存docx成功
保存pdf成功

Total translation time: 0.2 sec

请问这个是什么问题?感谢解答,祝周末愉快。

openai 使用有报错

使用open ai时,有以下报错信息:
Traceback (most recent call last):
File "C:\workspace\env\easytrans\Lib\site-packages\tenacity_init_.py", line 382, in call
result = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "C:\workspace\trans\EasyTrans-mac\translate_func.py", line 170, in translate
completion = openai.ChatCompletion.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\workspace\env\easytrans\Lib\site-packages\openai\lib_old_api.py", line 39, in call
raise APIRemovedInV1(symbol=self._symbol)
openai.lib._old_api.APIRemovedInV1:

You tried to access openai.ChatCompletion, but this is no longer supported in openai>=1.0.0 - see the README at https://github.com/openai/openai-python for the API.

You can run openai migrate to automatically upgrade your codebase to use the 1.0.0 interface.

Alternatively, you can pin your installation to the old version, e.g. pip install openai==0.28

A detailed migration guide is available here: openai/openai-python#742

翻译过程出现异常......

line 87, in main
img_list = cur_page.get_images() # 获取当前页面的图片对象
AttributeError: 'Page' object has no attribute 'get_images'

包依赖冲突

ERROR: Cannot install -r requirements.txt (line 8) and charset-normalizer==2.1.0 because these package versions have conflicting dependencies.

The conflict is caused by:
The user requested charset-normalizer==2.1.0
requests 2.27.1 depends on charset-normalizer~=2.0.0; python_version >= "3"

To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict
    requests版本换成2.28.1解决问题。

使用后发现有两个问题

一是对表格的处理不是很好,二是生成的pdf文件占用空间较大,3页pdf就5M了。
以上两点能改进下吗?
最后感谢作者无私开源精神

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.