2020-12-20 17:55:56 +01:00
|
|
|
#!/usr/bin/env python
|
2022-03-31 16:21:20 +02:00
|
|
|
import argparse
|
2022-12-30 00:44:53 +01:00
|
|
|
from libretranslate.init import check_and_install_models
|
2020-12-19 23:40:37 +01:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2022-03-31 16:21:20 +02:00
|
|
|
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
|
2022-03-31 16:21:20 +02:00
|
|
|
check_and_install_models(force=True, load_only_lang_codes=lang_codes)
|