mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-25 20:49:37 +01:00
60 lines
3.1 KiB
Docker
60 lines
3.1 KiB
Docker
FROM {base_image}
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
ENV TZ=Asia/Shanghai
|
|
ENV arch=x86_64
|
|
|
|
COPY docker/scripts/modelscope_env_init.sh /usr/local/bin/ms_env_init.sh
|
|
RUN apt-get update && \
|
|
apt-get install -y libsox-dev unzip libaio-dev zip iputils-ping telnet sudo git net-tools && \
|
|
apt-get clean && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
{extra_content}
|
|
|
|
COPY {meta_file} /tmp/install.sh
|
|
|
|
RUN sh /tmp/install.sh {version_args}
|
|
|
|
RUN pip uninstall ms-swift modelscope -y
|
|
|
|
RUN pip --no-cache-dir install pip==23.3.1
|
|
|
|
RUN pip --no-cache-dir install omegaconf==2.0.6
|
|
|
|
RUN pip install --no-cache-dir 'cython<=0.29.36' kwsbp==0.0.6 versioneer numpy==1.25.1 -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
|
|
|
|
# install dependencies
|
|
COPY requirements /var/modelscope
|
|
RUN 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 install --no-cache-dir -r /var/modelscope/server.txt && \
|
|
pip install --no-cache-dir https://modelscope.oss-cn-beijing.aliyuncs.com/packages/imageio_ffmpeg-0.4.9-py3-none-any.whl --force && \
|
|
pip install --no-cache-dir 'scipy<1.13.0' && \
|
|
pip cache purge
|
|
|
|
RUN echo "cache bust $(date +%Y%m%d%H%M%S)"
|
|
|
|
RUN cd /tmp && GIT_LFS_SKIP_SMUDGE=1 git clone -b {modelscope_branch} --single-branch https://github.com/modelscope/modelscope.git && cd modelscope && pip install . -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html && cd / && rm -fr /tmp/modelscope && pip cache purge;
|
|
|
|
RUN cd /tmp && GIT_LFS_SKIP_SMUDGE=1 git clone -b {swift_branch} --single-branch https://github.com/modelscope/ms-swift.git && cd ms-swift && pip install .[all] && cd / && rm -fr /tmp/ms-swift && pip cache purge;
|
|
|
|
RUN pip install --no-cache-dir torch=={torch_version} torchvision=={torchvision_version} torchaudio=={torchaudio_version} {index_url}
|
|
|
|
RUN pip install --no-cache-dir transformers -U huggingface-hub==0.25.0
|
|
|
|
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple && \
|
|
pip config set install.trusted-host mirrors.aliyun.com && \
|
|
cp /tmp/resources/ubuntu2204.aliyun /etc/apt/sources.list
|
|
|
|
ENV SETUPTOOLS_USE_DISTUTILS=stdlib
|
|
ENV VLLM_USE_MODELSCOPE=True
|
|
ENV LMDEPLOY_USE_MODELSCOPE=True
|
|
ENV MODELSCOPE_CACHE=/mnt/workspace/.cache/modelscope
|
|
SHELL ["/bin/bash", "-c"]
|