ah i think that’s because the trainer removes unused columns like text by default (see docs 4). what happens if you set remove_unused_columns=False in your TrainingArguments?
fyi there is a related issue here that might contain additional info for your use case: ERROR WHEN USING SET_TRANSFORM() · Issue #1867 · huggingface/datasets · GitHub 5