From c17832a37cd5c35c67ae5f5c0c73bdb3290aa746 Mon Sep 17 00:00:00 2001 From: Micha Gorelick Date: Tue, 3 Jan 2023 11:03:06 +0000 Subject: [PATCH 1/3] Optimize dockerfile.cuda for dev builds install large packages before copying repo over to container so that we can use build caches more efficiently. --- docker/Dockerfile.cuda | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile.cuda b/docker/Dockerfile.cuda index 6bd1603..61f7f0f 100644 --- a/docker/Dockerfile.cuda +++ b/docker/Dockerfile.cuda @@ -16,12 +16,12 @@ RUN apt-get update && apt-get upgrade --assume-yes RUN pip3 install --upgrade pip && apt-get remove python3-pip --assume-yes -COPY . . - RUN ln -s /usr/bin/python3 /usr/bin/python RUN pip3 install torch==1.12.0+cu116 -f https://download.pytorch.org/whl/torch_stable.html +COPY . . + RUN if [ "$with_models" = "true" ]; then \ # install only the dependencies first pip3 install -e .; \ From cca7dd5eac1d50c5c1efae752d93b74be7becad2 Mon Sep 17 00:00:00 2001 From: Micha Gorelick Date: Tue, 3 Jan 2023 12:40:05 +0000 Subject: [PATCH 2/3] Fixed un-modified reference to app from a23a9fbd7528d7f37dc2b88114f119e339cadc4d --- libretranslate/init.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretranslate/init.py b/libretranslate/init.py index d0cb23e..24706b8 100644 --- a/libretranslate/init.py +++ b/libretranslate/init.py @@ -53,7 +53,7 @@ def check_and_install_models(force=False, load_only_lang_codes=None): package.install_from_path(download_path) # reload installed languages - app.language.languages = translate.get_installed_languages() + libretranslate.language.languages = translate.get_installed_languages() print( "Loaded support for %s languages (%s models total)!" % (len(translate.get_installed_languages()), len(available_packages)) From 468b4923f307113bebbf0d797c8791131e860280 Mon Sep 17 00:00:00 2001 From: Micha Gorelick Date: Tue, 3 Jan 2023 12:40:45 +0000 Subject: [PATCH 3/3] Bump argostranslate's patch version to 1.7.5 --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 1ac09fa..bb13088 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -argostranslate==1.7.0 +argostranslate==1.7.5 Flask==2.2.2 flask-swagger==0.2.14 flask-swagger-ui==4.11.1 @@ -15,4 +15,4 @@ itsdangerous==2.1.2 Werkzeug==2.2.2 requests==2.28.1 redis==4.3.4 -prometheus-client==0.15.0 \ No newline at end of file +prometheus-client==0.15.0