From 4e2555c5a36212201b59708aa8832193fb740d81 Mon Sep 17 00:00:00 2001 From: liuyhwangyh Date: Mon, 22 Jul 2024 20:58:32 +0800 Subject: [PATCH] Release/1.16 merge to master (#922) * update version * merge master * fix fairseq issue * fix pip compatible issue * fix bug * version to 1.16.1 * xformers<0.0.27 * fix matplotlib.cm compatible issue * remove transformers from frameowrk * vllm to 0.5.1 * not upgrade pip * add Pillow to framework * Update version.py --------- Co-authored-by: xingjun.wang Co-authored-by: mulin.lyh --- docker/Dockerfile.ubuntu | 10 ++++------ .../models/cv/video_depth_estimation/utils/depth.py | 4 +++- requirements/framework.txt | 2 +- requirements/multi-modal.txt | 3 ++- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docker/Dockerfile.ubuntu b/docker/Dockerfile.ubuntu index 8e7543cd..ed7c0cba 100644 --- a/docker/Dockerfile.ubuntu +++ b/docker/Dockerfile.ubuntu @@ -36,15 +36,14 @@ RUN if [ "$USE_GPU" = "True" ] ; then \ # install dependencies 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 && \ +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/svr.txt && \ + 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 @@ -53,14 +52,13 @@ COPY examples /modelscope/examples # torchmetrics==0.11.4 for ofa # tinycudann for cuda12.1.0 pytorch 2.1.2 RUN if [ "$USE_GPU" = "True" ] ; then \ - pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir torchsde jupyterlab torchmetrics==0.11.4 tiktoken transformers_stream_generator bitsandbytes basicsr optimum && \ pip install --no-cache-dir flash_attn==2.5.9.post1 -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html && \ pip install --no-cache-dir auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu121/ && \ - pip install --no-cache-dir -U 'xformers' --index-url https://download.pytorch.org/whl/cu121 && \ + pip install --no-cache-dir -U 'xformers<0.0.27' --index-url https://download.pytorch.org/whl/cu121 && \ pip install --no-cache-dir --force tinycudann==1.7 -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html && \ pip uninstall -y torch-scatter && TORCH_CUDA_ARCH_LIST="6.0;6.1;6.2;7.0;7.5;8.0;8.6;8.9;9.0" pip install --no-cache-dir -U torch-scatter && \ - pip install --no-cache-dir -U triton vllm https://modelscope.oss-cn-beijing.aliyuncs.com/packages/lmdeploy-0.5.0-cp310-cp310-linux_x86_64.whl; \ + pip install --no-cache-dir -U triton 'vllm==0.5.1' https://modelscope.oss-cn-beijing.aliyuncs.com/packages/lmdeploy-0.5.0-cp310-cp310-linux_x86_64.whl; \ else \ echo 'cpu unsupport vllm auto-gptq'; \ fi diff --git a/modelscope/models/cv/video_depth_estimation/utils/depth.py b/modelscope/models/cv/video_depth_estimation/utils/depth.py index 5fbf6aa6..2fc16a01 100644 --- a/modelscope/models/cv/video_depth_estimation/utils/depth.py +++ b/modelscope/models/cv/video_depth_estimation/utils/depth.py @@ -3,7 +3,9 @@ import numpy as np import torch import torchvision.transforms as transforms -from matplotlib.cm import get_cmap +# from matplotlib.cm import get_cmap +# compatible with matplotlib 3.9.0 +from matplotlib.pyplot import get_cmap from modelscope.models.cv.video_depth_estimation.utils.image import ( flip_lr, gradient_x, gradient_y, interpolate_image, load_image) diff --git a/requirements/framework.txt b/requirements/framework.txt index d6317bf2..c8a4c277 100644 --- a/requirements/framework.txt +++ b/requirements/framework.txt @@ -3,11 +3,11 @@ attrs datasets>=2.16.0,<2.19.0 einops oss2 +Pillow python-dateutil>=2.1 scipy # latest version has some compatible issue. setuptools==69.5.1 simplejson>=3.3.0 sortedcontainers>=1.5.9 -transformers urllib3>=1.26 diff --git a/requirements/multi-modal.txt b/requirements/multi-modal.txt index b4d551c2..6c974b56 100644 --- a/requirements/multi-modal.txt +++ b/requirements/multi-modal.txt @@ -2,7 +2,8 @@ accelerate cloudpickle decord>=0.6.0 diffusers>=0.25.0 -fairseq +# 0.12.1 has issue of No such file or directory: 'fairseq/version.txt' +fairseq==0.12.2 ftfy>=6.0.3 librosa==0.10.1 opencv-python