Skip to content

Commit 3019e55

Browse files
committed
tokenizer.default_chat_template has been removed
1 parent 83da94b commit 3019e55

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

scripts/convert.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -232,16 +232,7 @@ def main():
232232
tokenizer = None
233233
try:
234234
# Load tokenizer
235-
tokenizer = AutoTokenizer.from_pretrained(
236-
tokenizer_id, **from_pretrained_kwargs)
237-
238-
# To avoid inserting all chat templates into tokenizers.js, we save the chat template
239-
# to the tokenizer_config.json file, and load it when the tokenizer is loaded.
240-
if getattr(tokenizer, 'chat_template', None) is None and \
241-
getattr(tokenizer, 'use_default_system_prompt', False):
242-
# No chat template specified, and we use the default
243-
setattr(tokenizer, 'chat_template',
244-
tokenizer.default_chat_template)
235+
tokenizer = AutoTokenizer.from_pretrained(tokenizer_id, **from_pretrained_kwargs)
245236

246237
except KeyError:
247238
pass # No Tokenizer

0 commit comments

Comments
 (0)