更新了api_url的使用方法,增加了更为小白的示例 (#45)

This commit is contained in:
Tongzhao9417 2023-03-05 16:45:02 +08:00 committed by GitHub
parent 7249540e98
commit 602ac2ca3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View File

@ -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 如果想要速度可以付费

View File

@ -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