1
0
mirror of https://github.com/LibreTranslate/LibreTranslate.git synced 2024-12-18 08:27:03 +02:00
LibreTranslate/install_models.py

14 lines
545 B
Python
Raw Normal View History

2020-12-20 18:55:56 +02:00
#!/usr/bin/env python
import argparse
from app.init import check_and_install_models, check_and_install_transliteration
2020-12-20 00:40:37 +02:00
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--load_only_lang_codes", type=str, default="")
args = parser.parse_args()
2022-04-01 16:01:15 +02:00
lang_codes = args.load_only_lang_codes.split(",")
2022-04-01 16:06:03 +02:00
if len(lang_codes) == 0 or lang_codes[0] == '':
2022-04-01 16:01:15 +02:00
lang_codes = None
check_and_install_models(force=True, load_only_lang_codes=lang_codes)
check_and_install_transliteration(force=True)