mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2024-11-25 09:21:04 +00:00
Add --threads
This commit is contained in:
parent
e4fe0e8919
commit
1dddcea794
3 changed files with 14 additions and 0 deletions
|
@ -197,6 +197,7 @@ docker-compose -f docker-compose.cuda.yml up -d --build
|
|||
| --get-api-key-link | Show a link in the UI where to direct users to get an API key | `Don't show a link` | LT_GET_API_KEY_LINK |
|
||||
| --require-api-key-origin | Require use of an API key for programmatic access to the API, unless the request origin matches this domain | `No restrictions on domain origin` | LT_REQUIRE_API_KEY_ORIGIN |
|
||||
| --load-only | Set available languages | `all from argostranslate` | LT_LOAD_ONLY |
|
||||
| --threads | Set number of threads | `4` | LT_THREADS |
|
||||
| --suggestions | Allow user suggestions | `false` | LT_SUGGESTIONS |
|
||||
| --disable-files-translation | Disable files translation | `false` | LT_DISABLE_FILES_TRANSLATION |
|
||||
| --disable-web-ui | Disable web ui | `false` | LT_DISABLE_WEB_UI |
|
||||
|
|
|
@ -131,6 +131,11 @@ _default_options_objects = [
|
|||
'default_value': None,
|
||||
'value_type': 'str'
|
||||
},
|
||||
{
|
||||
'name': 'THREADS',
|
||||
'default_value': 4,
|
||||
'value_type': 'int'
|
||||
},
|
||||
{
|
||||
'name': 'SUGGESTIONS',
|
||||
'default_value': False,
|
||||
|
|
|
@ -120,6 +120,13 @@ def get_args():
|
|||
metavar="<comma-separated language codes>",
|
||||
help="Set available languages (ar,de,en,es,fr,ga,hi,it,ja,ko,pt,ru,zh)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--threads",
|
||||
default=DEFARGS['THREADS'],
|
||||
type=int,
|
||||
metavar="<number of threads>",
|
||||
help="Set number of threads (%(default)s)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--suggestions", default=DEFARGS['SUGGESTIONS'], action="store_true", help="Allow user suggestions"
|
||||
)
|
||||
|
@ -154,6 +161,7 @@ def main():
|
|||
host=args.host,
|
||||
port=args.port,
|
||||
url_scheme=url_scheme,
|
||||
threads=args.threads
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue