From c404885d5dbf90a0b72ca745728a7c697ac49f0e Mon Sep 17 00:00:00 2001 From: "P.J. Finlay" Date: Sat, 4 Feb 2023 10:25:17 -0600 Subject: [PATCH] Upgrade to Argos Translate 1.8 Uses argostranslate.package.Package.install which deletes the cached package file after it has been installed --- .gitignore | 3 +++ libretranslate/init.py | 3 +-- requirements.txt | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 4c46265..5f977fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Ignore db/sessions/ +db/ + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/libretranslate/init.py b/libretranslate/init.py index 24706b8..b6238fa 100644 --- a/libretranslate/init.py +++ b/libretranslate/init.py @@ -49,8 +49,7 @@ def check_and_install_models(force=False, load_only_lang_codes=None): "Downloading %s (%s) ..." % (available_package, available_package.package_version) ) - download_path = available_package.download() - package.install_from_path(download_path) + available_package.install() # reload installed languages libretranslate.language.languages = translate.get_installed_languages() diff --git a/requirements.txt b/requirements.txt index e7fe151..a725f4c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -argostranslate==1.7.5 +argostranslate==1.8.0 Flask==2.2.2 flask-swagger==0.2.14 flask-swagger-ui==4.11.1