I know there’s another closed Topic
But I have a different suggestion.
I’d like to upload models
LT_LOAD_ONLY_FROM=en
LT_LOAD_ONLY_TO=ru,uk,fr,es,de,it,pt,ko,tr,cs,ar,zh,fa,pl,da,nl,hi,hu,ja,sk,sv,fi
And I’d like to get models to translate only from English to other languages, not the opposite way around.
This isn’t supported using the LT_LOAD_ONLY parameter but you can install the specific models you want manually:
Command line
argospm install translate-en_es
Python install from file
import pathlib
import argostranslate.package
package_path = pathlib.Path("/root/translate-en_it-2_0.argosmodel")
argostranslate.package.install_from_path(package_path)
Python install from package index
import argostranslate.package
import argostranslate.translate
from_code = "en"
to_code = "es"
# Download and install Argos Translate package
argostranslate.package.update_package_index()
available_packages = argostranslate.package.get_available_packages()
package_to_install = next(
filter(
lambda x: x.from_code == from_code and x.to_code == to_code, available_packages
)
)
argostranslate.package.install_from_path(package_to_install.download())