mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-25 20:49:37 +01:00
63 lines
3.7 KiB
Docker
63 lines
3.7 KiB
Docker
ARG BASE_IMAGE=reg.docker.alibaba-inc.com/modelscope/modelscope:ubuntu20.04-cuda11.3.0-py37-torch1.11.0-tf1.15.5-base
|
|
FROM $BASE_IMAGE
|
|
|
|
RUN apt-get update && apt-get install -y iputils-ping net-tools iproute2 && \
|
|
apt-get clean && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
# install modelscope
|
|
COPY requirements /var/modelscope
|
|
RUN pip install --no-cache-dir --upgrade pip && \
|
|
pip install --no-cache-dir -r /var/modelscope/framework.txt -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html && \
|
|
pip install --no-cache-dir -r /var/modelscope/audio.txt -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html && \
|
|
pip install --no-cache-dir -r /var/modelscope/cv.txt -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html && \
|
|
pip install --no-cache-dir -r /var/modelscope/multi-modal.txt -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html && \
|
|
pip install --no-cache-dir -r /var/modelscope/nlp.txt -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html && \
|
|
pip install --no-cache-dir -r /var/modelscope/science.txt -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html && \
|
|
pip install --no-cache-dir -r /var/modelscope/tests.txt -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html && \
|
|
pip cache purge
|
|
|
|
# install jupyter plugin
|
|
RUN mkdir -p /root/.local/share/jupyter/labextensions/ && \
|
|
cp -r /tmp/resources/jupyter_plugins/* /root/.local/share/jupyter/labextensions/
|
|
|
|
COPY docker/scripts/modelscope_env_init.sh /usr/local/bin/ms_env_init.sh
|
|
# python3.8 pip install git+https://github.com/jin-s13/xtcocoapi.git@v1.13
|
|
# pip install git+https://github.com/gatagat/lap.git@v0.4.0
|
|
RUN pip install --no-cache-dir text2sql_lgesql==1.3.0 \
|
|
git+https://github.com/jin-s13/xtcocoapi.git@v1.13 \
|
|
git+https://github.com/gatagat/lap.git@v0.4.0 \
|
|
detectron2==0.3 -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html --force --no-deps
|
|
|
|
RUN pip install --no-cache-dir mpi4py paint_ldm \
|
|
mmcls>=0.21.0 mmdet>=2.25.0 decord>=0.6.0 pai-easycv ms_swift \
|
|
ipykernel fasttext fairseq deepspeed -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
|
|
|
|
ARG USE_GPU
|
|
# for cpu install cpu version faiss, faiss depends on blas lib, we install libopenblas TODO rename gpu or cpu version faiss
|
|
RUN if [ "$USE_GPU" = "True" ] ; then \
|
|
pip install --no-cache-dir funtextprocessing kwsbp==0.0.6 faiss==1.7.2 safetensors typeguard==2.13.3 scikit-learn librosa==0.9.2 funasr -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html; \
|
|
else \
|
|
pip install --no-cache-dir funtextprocessing kwsbp==0.0.6 https://modelscope.oss-cn-beijing.aliyuncs.com/releases/dependencies/faiss-1.7.2-py37-none-linux_x86_64.whl safetensors typeguard==2.13.3 scikit-learn librosa==0.9.2 funasr -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html; \
|
|
fi
|
|
|
|
RUN pip install --no-cache-dir wenetruntime==1.11.0 adaseq --no-deps
|
|
COPY examples /modelscope/examples
|
|
|
|
# for pai-easycv setup compatiblity issue
|
|
ENV SETUPTOOLS_USE_DISTUTILS=stdlib
|
|
|
|
RUN if [ "$USE_GPU" = "True" ] ; then \
|
|
CUDA_HOME=/usr/local/cuda TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6" pip install --no-cache-dir 'git+https://github.com/facebookresearch/detectron2.git'; \
|
|
else \
|
|
echo 'cpu unsupport detectron2'; \
|
|
fi
|
|
|
|
# torchmetrics==0.11.4 for ofa
|
|
RUN pip install --no-cache-dir jupyterlab torchmetrics==0.11.4 tiktoken transformers_stream_generator 'protobuf<=3.20.0' bitsandbytes basicsr
|
|
COPY docker/scripts/install_flash_attension.sh /tmp/install_flash_attension.sh
|
|
RUN if [ "$USE_GPU" = "True" ] ; then \
|
|
bash /tmp/install_flash_attension.sh; \
|
|
else \
|
|
echo 'cpu unsupport flash attention'; \
|
|
fi
|