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] 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