mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-16 08:17:45 +01:00
fix some transformers version missing the chat template definition (#1368)
This commit is contained in:
@@ -243,13 +243,12 @@ def _patch_pretrained_class(all_imported_modules, wrap=False):
|
||||
from transformers.tokenization_utils import SPECIAL_TOKENS_MAP_FILE
|
||||
from transformers.tokenization_utils import TOKENIZER_CONFIG_FILE
|
||||
from transformers.tokenization_utils_base import FULL_TOKENIZER_FILE
|
||||
from transformers.tokenization_utils_base import CHAT_TEMPLATE_FILE
|
||||
extra_allow_file_pattern = list(
|
||||
(cls.vocab_files_names.values()) if cls is not None
|
||||
and hasattr(cls, 'vocab_files_names') else []) + [
|
||||
ADDED_TOKENS_FILE, SPECIAL_TOKENS_MAP_FILE,
|
||||
TOKENIZER_CONFIG_FILE, FULL_TOKENIZER_FILE,
|
||||
CHAT_TEMPLATE_FILE, r'*.py'
|
||||
'chat_template.jinja', r'*.py'
|
||||
] # noqa
|
||||
elif 'Processor' in module_class.__name__:
|
||||
from transformers.utils import FEATURE_EXTRACTOR_NAME
|
||||
|
||||
Reference in New Issue
Block a user