mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-05-14 14:02:52 +00:00
ISO lang code support for --load-only
Some checks are pending
Build and Publish Docker Image / main (push) Waiting to run
Run tests / tests_python (3.9) (push) Waiting to run
Run tests / test_docker_build (push) Waiting to run
Run tests / tests_python (3.10) (push) Waiting to run
Run tests / tests_python (3.8) (push) Waiting to run
Some checks are pending
Build and Publish Docker Image / main (push) Waiting to run
Run tests / tests_python (3.9) (push) Waiting to run
Run tests / test_docker_build (push) Waiting to run
Run tests / tests_python (3.10) (push) Waiting to run
Run tests / tests_python (3.8) (push) Waiting to run
This commit is contained in:
parent
29c9f39e8f
commit
182f6063f0
2 changed files with 5 additions and 0 deletions
|
@ -27,6 +27,8 @@ def check_and_install_models(force=False, load_only_lang_codes=None,update=False
|
|||
print("Found %s models" % len(available_packages))
|
||||
if load_only_lang_codes is not None:
|
||||
# load_only_lang_codes: List[str] (codes)
|
||||
load_only_lang_codes = libretranslate.language.iso2model(load_only_lang_codes)
|
||||
|
||||
# Ensure the user does not use any unavailable language code.
|
||||
unavailable_lang_codes = set(load_only_lang_codes)
|
||||
for pack in available_packages:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue