@@ -189,38 +189,3 @@ def test_star_hidden_tail_and_suffix_slot(self, simple_tokenizer):
189189 # MLM masks only in suffix slot
190190 suffix_region = batch ["input_ids" ][0 , 4 :visible_len ]
191191 assert (suffix_region == mask ).any ()
192-
193- def test_tinygsm_variable_prefix_no_shared_block (self , simple_tokenizer ):
194- torch .manual_seed (0 )
195- pad = simple_tokenizer .pad_token_id
196- eos = simple_tokenizer .eos_token_id
197- mask = simple_tokenizer .mask_token_id
198- block_size = 8
199-
200- batch = prepare_prefix_suffix_ids (
201- prefix_ids = [[10 , 11 , 12 , 13 , 14 ], [20 , 21 ]],
202- suffix_ids = [[30 , 31 ], [40 , 41 , 42 ]],
203- pad_token_id = pad ,
204- mask_token_id = mask ,
205- eos_token_id = eos ,
206- bos_token_id = None ,
207- max_seq_len = None ,
208- truncate = None ,
209- suffix_block_size = block_size ,
210- )
211-
212- # Batch padded to max visible: 5 + 8 = 13 vs 2 + 8 = 10
213- assert batch ["input_ids" ].shape == (2 , 13 )
214- visible_len_0 = 5 + block_size
215- visible_len_1 = 2 + block_size
216- assert batch ["attention_mask" ][0 , :visible_len_0 ].all ()
217- assert not batch ["attention_mask" ][0 , visible_len_0 :].any ()
218- assert batch ["attention_mask" ][1 , :visible_len_1 ].all ()
219- assert not batch ["attention_mask" ][1 , visible_len_1 :].any ()
220- assert (batch ["target_ids" ][1 , visible_len_1 :] == - 100 ).all ()
221- # Suffix slot starts right after prompt (no BOS); check targets for layout
222- assert batch ["target_ids" ][0 , 5 ] == 30
223- assert batch ["target_ids" ][0 , 6 ] == 31
224- assert batch ["target_ids" ][0 , 7 ] == eos
225- assert (batch ["input_ids" ][0 , 5 :visible_len_0 ] == mask ).any ()
226- assert (batch ["input_ids" ][0 , :5 ] != mask ).all ()
0 commit comments