I’m not sure about if I understood it.
In short you have lot of datasamples in a compressed file, thus it’s not word to decompress that for reading a single file.
What you can try to do is to generate those compressed files having (each of them) a balanced amount of samples of each class. Then you can customize the dataloader to load data from each compressed file, compressed file by compressed file.
I’m not sure if multiprocessing can help you, since it’s used to parallelize a function but you cannot accelerate (in a simple way) the decompression step in case of having a big file.
In case you use smaller files, notice the dataloader class provides multiprocessing. They also provide random sampling.