mirror of
https://github.com/yihong0618/bilingual_book_maker.git
synced 2025-06-07 03:55:30 +00:00
Update Docker command in README.md (#99)
This commit is contained in:
parent
cdeaaea6ce
commit
8a4806c693
18
README.md
18
README.md
@ -9,17 +9,16 @@ The bilingual_book_maker is an AI translation tool that uses ChatGPT to assist u
|
|||||||
## Preparation
|
## Preparation
|
||||||
|
|
||||||
1. ChatGPT or OpenAI token
|
1. ChatGPT or OpenAI token
|
||||||
2. prepared epub books
|
2. Prepared epub books
|
||||||
3. Environment with internet access or proxy
|
3. Environment with internet access or proxy
|
||||||
4. python3.8+
|
4. Python 3.8+
|
||||||
|
|
||||||
|
|
||||||
## Use
|
## Use
|
||||||
|
|
||||||
1. pip install -r requirements.txt
|
1. pip install -r requirements.txt
|
||||||
2. OpenAI API key. If you have multiple keys, separate them by commas (xxx,xxx,xxx) to reduce errors caused by API call limits.
|
2. OpenAI API key. If you have multiple keys, separate them by commas (xxx,xxx,xxx) to reduce errors caused by API call limits.
|
||||||
3. A sample book, test_books/animal_farm.epub, is provided for testing purposes.
|
3. A sample book, test_books/animal_farm.epub, is provided for testing purposes.
|
||||||
4. The default underlying model is [GPT-3.5-turbo](https://openai.com/blog/introducing-chatgpt-and-whisper-apis) ,which is used by ChatGPT currently. Use `--model gpt3` to change the underlying model to `GPT3`
|
4. The default underlying model is [GPT-3.5-turbo](https://openai.com/blog/introducing-chatgpt-and-whisper-apis), which is used by ChatGPT currently. Use `--model gpt3` to change the underlying model to `GPT3`
|
||||||
5. Use --test command to preview the result if you haven't paid for the service. Note that there is a limit and it may take some time.
|
5. Use --test command to preview the result if you haven't paid for the service. Note that there is a limit and it may take some time.
|
||||||
6. Set the target language like `--language "Simplified Chinese"`.
|
6. Set the target language like `--language "Simplified Chinese"`.
|
||||||
Support ` "Japanese" / "Traditional Chinese" / "German" / "French" / "Korean"`.
|
Support ` "Japanese" / "Traditional Chinese" / "German" / "French" / "Korean"`.
|
||||||
@ -64,18 +63,19 @@ $language=your_language # see utils.py
|
|||||||
|
|
||||||
docker run --rm --name bilingual_book_maker --mount type=bind,source=$folder_path,target='/app/test_books' bilingual_book_maker --book_name "/app/test_books/$book_name" --openai_key $openai_key --no_limit --language $language
|
docker run --rm --name bilingual_book_maker --mount type=bind,source=$folder_path,target='/app/test_books' bilingual_book_maker --book_name "/app/test_books/$book_name" --openai_key $openai_key --no_limit --language $language
|
||||||
|
|
||||||
# linux
|
# Linux
|
||||||
export folder_path=${your_folder_path}
|
export folder_path=${your_folder_path}
|
||||||
export book_name=${your_book_name}
|
export book_name=${your_book_name}
|
||||||
export openai_key=${your_api_key}
|
export openai_key=${your_api_key}
|
||||||
export language=${your_language}
|
export language=${your_language}
|
||||||
|
|
||||||
docker container run --rm --name bilingual_book_maker --mount type=bind,source=${folder_path},target='/app/test_books' bilingual_book_maker --book_name "/app/test_books/${book_name}" --openai_key ${openai_key} --no_limit --language "${language}"
|
docker run --rm --name bilingual_book_maker --mount type=bind,source=${folder_path},target='/app/test_books' bilingual_book_maker --book_name "/app/test_books/${book_name}" --openai_key ${openai_key} --no_limit --language "${language}"
|
||||||
```
|
```
|
||||||
for example,
|
|
||||||
|
e.g.
|
||||||
```shell
|
```shell
|
||||||
# linux
|
# Linux
|
||||||
docker container run --rm --name bilingual_book_maker --mount type=bind,source=/home/user/my_books,target='/app/test_books' bilingual_book_maker --book_name /app/test_books/animal_farm.epub --openai_key sk-XXX --no_limit --test --test_num 1 --language zh-hant
|
docker run --rm --name bilingual_book_maker --mount type=bind,source=/home/user/my_books,target='/app/test_books' bilingual_book_maker --book_name /app/test_books/animal_farm.epub --openai_key sk-XXX --no_limit --test --test_num 1 --language zh-hant
|
||||||
```
|
```
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user