mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2024-11-15 04:00:11 +01:00
18 lines
574 B
Python
Executable File
18 lines
574 B
Python
Executable File
#!/usr/bin/env python
|
|
import os
|
|
import sys
|
|
|
|
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
|
import argparse
|
|
|
|
from libretranslate.init import check_and_install_models
|
|
|
|
if __name__ == "__main__":
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("--load_only_lang_codes", type=str, default="")
|
|
args = parser.parse_args()
|
|
lang_codes = args.load_only_lang_codes.split(",")
|
|
if len(lang_codes) == 0 or lang_codes[0] == '':
|
|
lang_codes = None
|
|
check_and_install_models(force=True, load_only_lang_codes=lang_codes)
|