@@ -32,10 +32,82 @@ pip3 install -r requirements.txt
3232 [Custom]
3333 Url=http://<server_url>:<server_port>/translate
3434 ```
35- Turn on server in console:
36- ```bash
37- python3 main.py
38- ```
35+ 3. start main.py
36+ ```sh
37+ usage: main.py [-h] [--base-url BASE_URL] [--api-key API_KEY] [--model-name MODEL_NAME] [--temperature TEMPERATURE] [--max-tokens MAX_TOKENS]
38+ [--frequency-penalty FREQUENCY_PENALTY] [--presence-penalty PRESENCE_PENALTY] [--host HOST] [--port PORT] [--use-history]
39+ [--max-history MAX_HISTORY] [--use-latest-history] [--db-type DB_TYPE] [--cache-translation] [--use-cached-translation]
40+ [--use-latest-records] [--init-latest-records INIT_LATEST_RECORDS] [--postgres-host POSTGRES_HOST] [--postgres-port POSTGRES_PORT]
41+ [--postgres-user POSTGRES_USER] [--postgres-password POSTGRES_PASSWORD] [--postgres-db POSTGRES_DB] [--sqlite-db-path SQLITE_DB_PATH]
42+ [--log-file LOG_FILE] [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--task-template TASK_TEMPLATE] [--specify-language]
43+ [--language-template LANGUAGE_TEMPLATE] [--src-start SRC_START] [--src-end SRC_END] [--tgt-start TGT_START] [--tgt-end TGT_END]
44+ [--use-system-prompt] [--system-prompt SYSTEM_PROMPT] [--config CONFIG]
45+
46+ Application Configuration CLI
47+
48+ options:
49+ -h, --help show this help message and exit
50+ --base-url BASE_URL Base URL for OpenAI API
51+ --api-key API_KEY openai
52+ --model-name MODEL_NAME
53+ OpenAI model name
54+ --temperature TEMPERATURE
55+ Model temperature (randomness control)
56+ --max-tokens MAX_TOKENS
57+ Maximum number of tokens to generate
58+ --frequency-penalty FREQUENCY_PENALTY
59+ Penalty for repeated tokens
60+ --presence-penalty PRESENCE_PENALTY
61+ Penalty for new tokens
62+ --host HOST Server host address
63+ --port PORT Server port
64+ --use-history Enable history usage
65+ --max-history MAX_HISTORY
66+ Maximum number of history records
67+ --use-latest-history Use latest history records
68+ --db-type DB_TYPE Database type to use
69+ --cache-translation Enable translation caching
70+ --use-cached-translation
71+ Use cached translations if available
72+ --use-latest-records Use latest database records
73+ --init-latest-records INIT_LATEST_RECORDS
74+ Number of initial latest records
75+ --postgres-host POSTGRES_HOST
76+ PostgreSQL server host
77+ --postgres-port POSTGRES_PORT
78+ PostgreSQL server port
79+ --postgres-user POSTGRES_USER
80+ PostgreSQL username
81+ --postgres-password POSTGRES_PASSWORD
82+ PostgreSQL password
83+ --postgres-db POSTGRES_DB
84+ PostgreSQL database name
85+ --sqlite-db-path SQLITE_DB_PATH
86+ Path to the SQLite database file
87+ --log-file LOG_FILE Log file path
88+ --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
89+ Logging level
90+ --task-template TASK_TEMPLATE
91+ Template for the translation task
92+ --specify-language Specify source and target languages in the prompt
93+ --language-template LANGUAGE_TEMPLATE
94+ Template for specifying languages
95+ --src-start SRC_START
96+ Start tag for the source language
97+ --src-end SRC_END End tag for the source language
98+ --tgt-start TGT_START
99+ Start tag for the target language
100+ --tgt-end TGT_END End tag for the target language
101+ --use-system-prompt Enable system prompt
102+ --system-prompt SYSTEM_PROMPT
103+ System prompt to be used
104+ --config CONFIG Path to the TOML configuration file
105+ ```
106+
107+ Recommand args is
108+ ```sh
109+ 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
110+ ```
39111
40112### Docker Usage
41113#### docker run
0 commit comments