Skip to content

Apply custom randomization on __getitem__ during training. #5139

Closed Answered by mariosasko
ysig asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! You can use set_transform for that:

def transform(batch):
    batch["text"] = [shuffle_words(text) for text in batch["text"]]
    return batch

dset.set_transform(transform)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ysig
Comment options

Answer selected by ysig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants