(self, input_ids)
| 311 | return batch |
| 312 | |
| 313 | def _shift_right_t5(self, input_ids): |
| 314 | # shift inputs to the right |
| 315 | shifted_input_ids = input_ids.new_zeros(input_ids.shape) |
| 316 | shifted_input_ids[..., 1:] = input_ids[..., :-1].clone() |
| 317 | shifted_input_ids[..., 0] = self.pad_token_id |
| 318 | return shifted_input_ids |
| 319 | |
| 320 | def _encode(self, batch) -> Dict[str, torch.Tensor]: |
| 321 | batch_encoding = self.tokenizer.prepare_seq2seq_batch( |
nothing calls this directly
no outgoing calls
no test coverage detected