Spaces:
Sleeping
Sleeping
mrfakename
commited on
Commit
•
e8b82cc
1
Parent(s):
160209e
Sync from GitHub repo
Browse filesThis Space is synced from the GitHub repo: https://github.com/SWivid/F5-TTS. Please submit contributions to the Space there
- model/dataset.py +2 -0
model/dataset.py
CHANGED
@@ -103,6 +103,8 @@ class CustomDataset(Dataset):
|
|
103 |
|
104 |
else:
|
105 |
audio, source_sample_rate = torchaudio.load(audio_path)
|
|
|
|
|
106 |
|
107 |
if duration > 30 or duration < 0.3:
|
108 |
return self.__getitem__((index + 1) % len(self.data))
|
|
|
103 |
|
104 |
else:
|
105 |
audio, source_sample_rate = torchaudio.load(audio_path)
|
106 |
+
if audio.shape[0] > 1:
|
107 |
+
audio = torch.mean(audio, dim=0, keepdim=True)
|
108 |
|
109 |
if duration > 30 or duration < 0.3:
|
110 |
return self.__getitem__((index + 1) % len(self.data))
|