Skip to content

Commit 9cd36b2

Browse files
committed
docs: Update README.md
1 parent 74a7b04 commit 9cd36b2

File tree

1 file changed

+33
-24
lines changed

1 file changed

+33
-24
lines changed

README.md

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,9 @@ You can install the requirements with:
1818
pip3 install -r requirements.txt
1919
```
2020

21-
## Usage
22-
### Local Usage
23-
1. Install Dependencies
24-
2. Configure the provider in XUnity.AutoTranslator:
25-
1. Change Provider to 'CustomTranslate' in [Service] section.
26-
```
27-
[Service]
28-
Endpoint=CustomTranslate
29-
```
30-
2. Set server URL in [Custom] section.
31-
```
32-
[Custom]
33-
Url=http://<server_url>:<server_port>/translate
34-
```
35-
3. start main.py
36-
```sh
21+
## Configuration
22+
### CLI-configuration
23+
```bash
3724
usage: main.py [-h] [--base-url BASE_URL] [--api-key API_KEY] [--model-name MODEL_NAME] [--temperature TEMPERATURE] [--max-tokens MAX_TOKENS]
3825
[--frequency-penalty FREQUENCY_PENALTY] [--presence-penalty PRESENCE_PENALTY] [--host HOST] [--port PORT] [--use-history]
3926
[--max-history MAX_HISTORY] [--use-latest-history] [--db-type DB_TYPE] [--cache-translation] [--use-cached-translation]
@@ -104,8 +91,29 @@ pip3 install -r requirements.txt
10491
--config CONFIG Path to the TOML configuration file
10592
```
10693

94+
For docker, you can change args using Environment variables.
95+
Environment variables are listed in [Dockerfile](Dockerfile).
96+
97+
### pre-configuration file
98+
For docker, set `CONFIG` environment variable to target path, and you mount configuration file.
99+
100+
## Usage
101+
### Local Usage
102+
1. Install Dependencies
103+
2. Configure the provider in XUnity.AutoTranslator:
104+
1. Change Provider to 'CustomTranslate' in [Service] section.
105+
```
106+
[Service]
107+
Endpoint=CustomTranslate
108+
```
109+
2. Set server URL in [Custom] section.
110+
```
111+
[Custom]
112+
Url=http://<server_url>:<server_port>/translate
113+
```
114+
3. start main.py
107115
Recommand args is
108-
```sh
116+
```bash
109117
python main.py --model-name <model_name_to_use> --base-url <model_url_to_use> --api-key <api_key_to_use> --use-latest-history --cache-translation --use-cached-translation --use-latest-records --specify-language --use-system-prompt
110118
```
111119
@@ -120,10 +128,11 @@ docker run -d \
120128
-e API_KEY="api_key_here" \
121129
-e MODEL_NAME="gpt-3.5-turbo" \
122130
-e SQLITE_DB_PATH="translation.db" \
123-
-v ./translation.db:/app/translation.db \
131+
-v ./translation.db:translation.db \
124132
-p 5000:5000 \
125133
ghcr.io/returntofirst/xunity-autotranslator-openai:latest
126134
```
135+
127136
This command will server on port `5000`.
128137

129138
#### docker compose
@@ -154,13 +163,13 @@ If you want to run this container with kubernetes, use [k8s-example.yaml](k8s-ex
154163
- Description: Clears the current chat history.
155164

156165
## TODO
157-
- [ ] Docs
158-
- [ ] Installation
159-
- [ ] Requirements
160-
- [ ] Usage
161-
- [ ] Configuration
166+
- [x] Docs
167+
- [x] Installation
168+
- [x] Requirements
169+
- [x] Usage
170+
- [x] Configuration
162171
- [ ] Refactor
163-
- [ ] Server
172+
- [x] Server
164173
- [ ] Logger
165174
- [ ] Error handling
166175
- [ ] UI

0 commit comments

Comments
 (0)