From 6b70c8b57768de7a1361db772a352e016e91f36d Mon Sep 17 00:00:00 2001 From: tastelikefeet <58414341+tastelikefeet@users.noreply.github.com> Date: Mon, 18 Aug 2025 13:51:00 +0800 Subject: [PATCH 1/3] Merge 1.29 to master (#1469) --- docker/Dockerfile.ubuntu | 8 ++++---- docker/install.sh | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile.ubuntu b/docker/Dockerfile.ubuntu index 71a6f8b1..f72e4cc9 100644 --- a/docker/Dockerfile.ubuntu +++ b/docker/Dockerfile.ubuntu @@ -60,13 +60,13 @@ RUN sh /tmp/install.sh {version_args} && \ curl -fsSL https://ollama.com/install.sh | sh && \ pip install --no-cache-dir -U funasr scikit-learn && \ pip install --no-cache-dir -U qwen_vl_utils qwen_omni_utils librosa timm transformers accelerate peft trl safetensors && \ - 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; \ 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 .[llm] && \ pip install .[eval] && pip install evalscope -U --no-dependencies && pip install ms-agent -U --no-dependencies && \ cd / && rm -fr /tmp/ms-swift && pip cache purge; \ + 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; \ pip install --no-cache-dir torch=={torch_version} torchvision=={torchvision_version} torchaudio=={torchaudio_version} {index_url} && \ pip install --no-cache-dir transformers diffusers timm>=0.9.0 && pip cache purge; \ pip install --no-cache-dir omegaconf==2.3.0 && pip cache purge; \ @@ -76,7 +76,7 @@ RUN sh /tmp/install.sh {version_args} && \ RUN if [ "$INSTALL_MS_DEPS" = "True" ]; then \ - pip install --no-cache-dir huggingface-hub transformers -U; \ + pip install --no-cache-dir huggingface-hub transformers peft -U; \ fi; \ if [ "$INSTALL_MEGATRON_DEPS" = "True" ]; then \ pip install liger_kernel nvitop pre-commit transformers huggingface-hub -U && \ diff --git a/docker/install.sh b/docker/install.sh index d8380091..b15dab31 100644 --- a/docker/install.sh +++ b/docker/install.sh @@ -23,6 +23,11 @@ pip install --no-cache-dir tiktoken transformers_stream_generator bitsandbytes d # cd /tmp && git clone https://github.com/Dao-AILab/flash-attention.git && cd flash-attention && python setup.py install && cd / && rm -fr /tmp/flash-attention && pip cache purge; pip install --no-cache-dir flash_attn==$flashattn_version -pip install --no-cache-dir triton auto-gptq==$autogptq_version vllm==$vllm_version -U && pip cache purge +pip install --no-cache-dir triton auto-gptq==$autogptq_version -U && pip cache purge + +if [[ "$(printf '%s\n' "0.6.0" "$vllm_version" | sort -V | head -n1)" = "0.6.0" ]]; then + # vllm_version is >= 0.6.0 + pip install --no-cache-dir vllm==$vllm_version && pip cache purge +fi # 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 From a2c06735717fead129239b5497467f869a392f57 Mon Sep 17 00:00:00 2001 From: tastelikefeet <58414341+tastelikefeet@users.noreply.github.com> Date: Sat, 23 Aug 2025 10:43:56 +0800 Subject: [PATCH 2/3] support patch intern and deepseek (#1475) --- modelscope/utils/hf_util/patcher.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modelscope/utils/hf_util/patcher.py b/modelscope/utils/hf_util/patcher.py index 4e984d55..3665461f 100644 --- a/modelscope/utils/hf_util/patcher.py +++ b/modelscope/utils/hf_util/patcher.py @@ -42,6 +42,8 @@ def get_all_imported_modules(): 'BatchFeature', 'Qwen.*', 'Llama.*', + 'Intern.*', + 'Deepseek.*', 'PretrainedConfig', 'PreTrainedTokenizer', 'PreTrainedModel', @@ -242,11 +244,11 @@ def _patch_pretrained_class(all_imported_modules, wrap=False): extra_allow_file_pattern = list( (cls.vocab_files_names.values()) if cls is not None and hasattr(cls, 'vocab_files_names') else []) + [ - 'chat_template.jinja', r'*.json', r'*.py' + 'chat_template.jinja', r'*.json', r'*.py', r'*.txt' ] # noqa elif 'Processor' in module_class.__name__: extra_allow_file_pattern = [ - 'chat_template.jinja', r'*.json', r'*.py' + 'chat_template.jinja', r'*.json', r'*.py', r'*.txt' ] kwargs['allow_file_pattern'] = extra_allow_file_pattern From a5039281d397284d3c001ccc89dbbbc14d12a147 Mon Sep 17 00:00:00 2001 From: tastelikefeet <58414341+tastelikefeet@users.noreply.github.com> Date: Sat, 23 Aug 2025 11:12:35 +0800 Subject: [PATCH 3/3] skip aigc test (#1476) --- tests/hub/test_create_aigc_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hub/test_create_aigc_model.py b/tests/hub/test_create_aigc_model.py index 43065952..a17f9b8a 100644 --- a/tests/hub/test_create_aigc_model.py +++ b/tests/hub/test_create_aigc_model.py @@ -38,7 +38,7 @@ class TestCreateAigcModel(unittest.TestCase): os.remove(self.tmp_file_path) delete_credential() - @unittest.skipUnless(test_level() >= 0, 'skip test in current test level') + @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') def test_create_aigc_model_expects_sha256_error(self): """Test creating an AIGC model repository.