cool commited on
Commit
1f589f1
·
verified ·
1 Parent(s): 46e37ed

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -9
Dockerfile CHANGED
@@ -2,20 +2,18 @@ FROM libretranslate/libretranslate
2
 
3
  USER root
4
 
5
- # Create required directories
6
- RUN mkdir -p /.local && chmod 777 /.local /app/db
7
 
8
- # Copy model and install script
9
- COPY ./en_kab_comp /app/models/en_kab_comp
10
- COPY install_model.py /app/install_model.py
11
-
12
- # Install the Kabyle model using Python
13
- RUN /app/venv/bin/python3 /app/install_model.py
14
 
15
  # Set environment variables
16
  ENV LT_HOST="0.0.0.0"
17
  ENV LT_PORT="7860"
18
- ENV LT_LOAD_ONLY="en,fr,kab"
19
  ENV LT_SSL=True
20
 
21
  ENTRYPOINT ["/app/venv/bin/libretranslate"]
 
2
 
3
  USER root
4
 
5
+ # Install tools to download and extract model
6
+ RUN apt-get update && apt-get install -y curl unzip
7
 
8
+ # Download and install the Kabyle model
9
+ RUN curl -L -o /app/en_kab_comp.argosmodel \
10
+ https://huggingface.co/axxam/LibreTranslate_Kabyle/resolve/main/en_kab_comp.argosmodel && \
11
+ /app/venv/bin/python3 -c "import argostranslate.package; argostranslate.package.install_from_path('/app/en_kab_comp.argosmodel')"
 
 
12
 
13
  # Set environment variables
14
  ENV LT_HOST="0.0.0.0"
15
  ENV LT_PORT="7860"
16
+ ENV LT_LOAD_ONLY="en,es,de,fr,ru,zh,kab"
17
  ENV LT_SSL=True
18
 
19
  ENTRYPOINT ["/app/venv/bin/libretranslate"]