File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1265,8 +1265,9 @@ def test_chat_template_return_assistant_tokens_mask(self):
12651265 self .skipTest (reason = "No fast tokenizer defined" )
12661266
12671267 tokenizer_r = self .rust_tokenizer_class .from_pretrained (pretrained_name )
1268- if not tokenizer_r .pad_token or tokenizer .pad_token_id < 0 :
1269- self .skipTest (reason = "This tokenizer has no padding token set, or pad_token_id < 0" )
1268+ self ._check_no_pad_token_padding (tokenizer_r , conversations )
1269+
1270+ tokenizer_r .padding_side = "right"
12701271
12711272 # check batched
12721273 output = tokenizer_r .apply_chat_template (
@@ -1358,7 +1359,7 @@ def test_chat_template_return_assistant_tokens_mask(self):
13581359 )
13591360
13601361 self .assertEqual (type (output_pt ["assistant_masks" ]), torch .Tensor )
1361- self .assertEqual (output_pt ["assistant_masks" ].shape , output_pt ["attention_mask " ].shape )
1362+ self .assertEqual (output_pt ["assistant_masks" ].shape , output_pt ["input_ids " ].shape )
13621363
13631364 chat_string = tokenizer_r .apply_chat_template (
13641365 conversations [0 ], tokenize = False , chat_template = dummy_template
You can’t perform that action at this time.
0 commit comments