mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-05-14 14:02:52 +00:00
Added option to update models rather than reinstall
This commit is contained in:
parent
81ba2b81e9
commit
78713d8017
5 changed files with 40 additions and 12 deletions
|
@ -10,8 +10,12 @@ from libretranslate.init import check_and_install_models
|
|||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--load_only_lang_codes", type=str, default="")
|
||||
parser.add_argument("--update", action='store_true')
|
||||
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)
|
||||
if args.update:
|
||||
check_and_install_models(update=True, load_only_lang_codes=lang_codes)
|
||||
else:
|
||||
check_and_install_models(force=True, load_only_lang_codes=lang_codes)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue