(example: Nested[tf.Tensor])
| 152 | |
| 153 | @seqio.map_over_dataset |
| 154 | def process_example_fn(example: Nested[tf.Tensor]) -> Nested[tf.Tensor]: |
| 155 | example["input_ids"] = tf.concat([[bos_id], example["target_labels"][:-1]], 0) |
| 156 | return example |
| 157 | |
| 158 | return process_example_fn |
| 159 |