Gemma Tokenizer add padding to the left, but the code to find sequence length assume pad tokens are added to the right
Reference:
|
sequence_lengths = torch.eq(input_ids, self.config.pad_token_id).int().argmax(-1) - 1 |
|
sequence_lengths = sequence_lengths % input_ids.shape[-1] |
|
sequence_lengths = sequence_lengths.to(logits.device) |
Gemma Tokenizer add padding to the left, but the code to find sequence length assume pad tokens are added to the right
Reference:
transformers/src/transformers/models/gemma/modeling_gemma.py
Lines 1318 to 1320 in 97c00cd