File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Original file line number Diff line number Diff line change @@ -154,7 +154,12 @@ def _try_load_from_tokenizer_json(self, path: Path) -> bool:
154
154
return True
155
155
with open (tokenizer_config_file , encoding = 'utf-8' ) as f :
156
156
tokenizer_config = json .load (f )
157
- chat_template = tokenizer_config .get ('chat_template' )
157
+ chat_template_alt = None
158
+ chat_template_file = path / 'chat_template.json'
159
+ if chat_template_file .is_file ():
160
+ with open (chat_template_file , encoding = 'utf-8' ) as f :
161
+ chat_template_alt = json .load (f ).get ('chat_template' )
162
+ chat_template = tokenizer_config .get ('chat_template' , chat_template_alt )
158
163
if chat_template is None or isinstance (chat_template , (str , list )):
159
164
self .chat_template = chat_template
160
165
else :
You can’t perform that action at this time.
0 commit comments