Change training data in Trainer with callback

Can we change the train_dataset during training using a custom Trainer callback?

Thanks,

I don’t think that’s possible no. To customize your own training loop, we really recommend using Accelerate.

Use a function for the dataset to insert data without a callback.

NOTE: I did not check but can be possible.

Also can combine multiple datasets.

Thanks for the replies!

Actually, I came up with a hack to stop the training based on a criteria using a custom callback. Then, I computed what I needed to change the training data and I overwrote it in the trainer after. Finally, I expanded the training epochs in the arguments to continue the training afterwards.