Update language models (Docker)

How can I update the language models on a running docker instance?

You can use the install_models.py script. But I think you’ll need to restart the process afterwards for the changes to take effect.

1 Like

Does install_models.py get run from within the libretranslate container, or in the outer server?

When I run it within the container I get this error trace:

> Traceback (most recent call last):
>   File "/app/scripts/./install_models.py", line 8, in <module>
>     from libretranslate.init import check_and_install_models
>   File "/app/libretranslate/__init__.py", line 2, in <module>
>     from .main import main
>   File "/app/libretranslate/main.py", line 6, in <module>
>     from libretranslate.app import create_app
>   File "/app/libretranslate/app.py", line 14, in <module>
>     import argostranslatefiles
> ModuleNotFoundError: No module named 'argostranslatefiles'

Once the models are updated, what is the recommended way to restart the container?

And finally, what is the method to check whether a model is loaded and operational (according to the container)?

Thanks!