You could use different approaches:

you could oversample the minority classes using a WeightedRandomSampler and increase the number of epochs
alternatively, you could duplicate indices of the minority classes using a Subset with the desired sample indices
or you could directly create copies of the minority class samples (this would use more memory, since you are copying real data)