From 602ac2ca3ec809cab2f23fdbda49d6578e952f15 Mon Sep 17 00:00:00 2001 From: Tongzhao9417 <42951960+Tongzhao9417@users.noreply.github.com> Date: Sun, 5 Mar 2023 16:45:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86api=5Furl=E7=9A=84?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=96=B9=E6=B3=95=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BA=86=E6=9B=B4=E4=B8=BA=E5=B0=8F=E7=99=BD=E7=9A=84=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B=20(#45)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-CN.md | 9 ++++++++- README.md | 8 +++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README-CN.md b/README-CN.md index 94b6afa..1b62820 100644 --- a/README-CN.md +++ b/README-CN.md @@ -24,7 +24,7 @@ Make bilingual epub books Using AI translate Default target language is `"Simplified Chinese"`. Support language list please see the LANGUAGES at [utils.py](./utils.py). 7. 加了 `--proxy` 参数,方便中国大陆的用户在本地测试时使用代理,传入类似 `http://127.0.0.1:7890` 的字符串 8. 加入 `--resume` 命令,可以手动中断后,加入命令继续执行。 -9. 如果你遇到了墙需要用 Cloudflare Workers 替换 api_base 请使用 `--api_base ${url}` 来替换 +9. 如果你遇到了墙需要用 Cloudflare Workers 替换 api_base 请使用 `--api_base ${url}` 来替换。**请注意,此处你输入的api应该是"`https://xxxx/v1`"的字样,域名需要用引号包裹** e.g. ```shell @@ -37,6 +37,13 @@ export OPENAI_API_KEY=${your_api_key} python3 make_book.py --book_name test_books/animal_farm.epub --model gpt3 --no_limit --language "Simplified Chinese" ``` +更加小白的示例 +```shell +python3 make_book.py --book_name 'animal_farm.epub' --openai_key sk-XXXXX --api_base 'https://xxxxx/v1' +# 有可能你不需要python3 而是python +python make_book.py --book_name 'animal_farm.epub' --openai_key sk-XXXXX --api_base 'https://xxxxx/v1' +``` + ## 注意 1. 有 limit 如果想要速度可以付费 diff --git a/README.md b/README.md index aec1703..5b024d0 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Make bilingual epub books Using AI translate Default target language is `"Simplified Chinese"`. Support language list please see the LANGUAGES at [utils.py](./utils.py). 7. Use the --proxy parameter to enable users in mainland China to use a proxy when testing locally. Enter a string such as http://127.0.0.1:7890. 8. Use the --resume command to manually resume the process after an interruption. -9. If you want to change api_base like using Cloudflare Workers Use --api_base ${url} to support it. +9. If you want to change api_base like using Cloudflare Workers Use --api_base ${url} to support it. **Note: the api url you input should be `https://xxxx/v1', and quotation marks are required. ** e.g. ```shell @@ -38,6 +38,12 @@ python3 make_book.py --book_name test_books/animal_farm.epub --openai_key ${open export OPENAI_API_KEY=${your_api_key} python3 make_book.py --book_name test_books/animal_farm.epub --model gpt3 --no_limit --language "Simplified Chinese" ``` +More understandable example +``` +python3 make_book.py --book_name 'animal_farm.epub' --openai_key sk-XXXXX --api_base 'https://xxxxx/v1' +# or +python make_book.py --book_name 'animal_farm.epub' --openai_key sk-XXXXX --api_base 'https://xxxxx/v1' +``` ## Notes