forked from mirrors/LibreTranslate
Add cuda pytorch install
Add info on adding cuda to the container path if needed
This commit is contained in:
parent
727b9192e8
commit
482a1c65c6
1 changed files with 7 additions and 1 deletions
|
@ -18,6 +18,8 @@ COPY . .
|
||||||
|
|
||||||
RUN ln -s /usr/bin/python3 /usr/bin/python
|
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
|
||||||
|
|
||||||
RUN if [ "$with_models" = "true" ]; then \
|
RUN if [ "$with_models" = "true" ]; then \
|
||||||
# install only the dependencies first
|
# install only the dependencies first
|
||||||
pip3 install -e .; \
|
pip3 install -e .; \
|
||||||
|
@ -32,6 +34,10 @@ RUN if [ "$with_models" = "true" ]; then \
|
||||||
# Install package from source code
|
# Install package from source code
|
||||||
RUN pip3 install . \
|
RUN pip3 install . \
|
||||||
&& pip3 cache purge
|
&& pip3 cache purge
|
||||||
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib:/usr/local/cuda/lib64
|
|
||||||
|
# Depending on your cuda install you may need to uncomment this line to allow the container to access the cuda libraries
|
||||||
|
# See: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions
|
||||||
|
# ENV LD_LIBRARY_PATH=/usr/local/cuda/lib:/usr/local/cuda/lib64
|
||||||
|
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
ENTRYPOINT [ "libretranslate", "--host", "0.0.0.0" ]
|
ENTRYPOINT [ "libretranslate", "--host", "0.0.0.0" ]
|
||||||
|
|
Loading…
Reference in a new issue