Giter Site home page Giter Site logo

file-translator's Introduction

file-translator

Utilize AI large models or API to translate files, supporting both Chinese and English translations, as well as PDF, docx, txt, and html.

利用AI大模型或者api翻译文件,支持中英文翻译,支持pdf、docx、txt、html。

翻译模型 Translation model

The default model is the Qwen1.5-14B-Chat-GPTQ-Int4 model from Ali Qianwen. You can change the model in lib/fanyi_qianwen.py.

默认采用阿里千问Qwen1.5-14B-Chat-GPTQ-Int4模型.可以在lib/fanyi_qianwen.py更改模型。

也可以采用线上大模型接口

https://help.aliyun.com/zh/dashscope/developer-reference/api-details?spm=a2c4g.11186623.0.0.c9c946c10uY6YR

set DASHSCOPE_API_KEY="xxx"

安装方法

环境依赖

py310+pytorch

https://pytorch.org/get-started/locally/

git clone https://github.com/lrjxgl/file-translator.git

cd file-translator

pip install -r requirements.txt

运行方法

python gradio_app.py

设置翻译引擎

python gradio_app.py --engine qianwen_online

资料参考

pdf翻译参考 https://github.com/SUSTYuxiao/PdfTranslator

file-translator's People

Contributors

lrjxgl avatar

Stargazers

 avatar  avatar houseme avatar

Watchers

 avatar

Forkers

shuaibibobo

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.