Spaces:
Running
Running
File size: 821 Bytes
9791162 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import sys,os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from tqdm import tqdm
from torch.utils.data import DataLoader
from omegaconf import OmegaConf
from vits.data_utils import TextAudioSpeakerSet
from vits.data_utils import TextAudioSpeakerCollate
from vits.data_utils import DistributedBucketSampler
hps = OmegaConf.load("./configs/base.yaml")
dataset = TextAudioSpeakerSet("files/valid.txt", hps.data)
for _ in tqdm(dataset):
pass
sampler = DistributedBucketSampler(
dataset,
4,
[150, 300, 450],
num_replicas=1,
rank=0,
shuffle=True)
collate_fn = TextAudioSpeakerCollate()
loader = DataLoader(dataset, num_workers=0, shuffle=False, pin_memory=True,
collate_fn=collate_fn, batch_sampler=sampler)
for _ in tqdm(loader):
pass
|