Skip to content

tcapelle/gpt_translate

Repository files navigation

PyPI version

gpt_translate: Translating MD files with GPT-4

This is a tool to translate the language in Markdown files.

You will need and OpenAI API key to use this tool.

Installation

We have a stable version on PyPi, so you can install it with pip:

$ pip install gpt-translate

or to get latest version from the repo:

$ cd gpt_translate
$ pip install .

Usage

We use GPT4 by default. You can change this on configs/model_config.yaml

You can add new languages by providing the language translation dictionaries in configs/language_dicts

To translate a single file:

$ gpt_translate.file README.md README_es_.md --language es

to translate a full folder recursively:

$ gpt_translate.folder docs docs_ja --language ja

If you don't know what to do, you can always do:

$ gpt_translate --help

TroubleShooting

If you have any trouble with the installation, you can always pass the --debug flag to get more information about what is happening:

$ gpt_translate.folder docs docs_ja --language ja --debug

this will get you a very verbose output (calls to models, inputs and outputs, etc.)