(element)
| 106 | """pre-tokenize the dataset before training; only collate during training""" |
| 107 | |
| 108 | def tokenize(element): |
| 109 | outputs = tokenizer( |
| 110 | element[dataset_text_field], |
| 111 | padding=False, |
| 112 | ) |
| 113 | return {"input_ids": outputs["input_ids"]} |
| 114 | |
| 115 | return dataset.map( |
| 116 | tokenize, |
nothing calls this directly
no outgoing calls
no test coverage detected