Skip to content

Commit

Permalink
[Hackathon 7th] 修复不存在 *.npy 文件的空文件夹导致的数据遍历错误 (#3948)
Browse files Browse the repository at this point in the history
* [Fix] empty npy folder

* [Update] assert empyt folder
  • Loading branch information
megemini authored Dec 31, 2024
1 parent 0ef3cfc commit 7d26f93
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ class MultiSpeakerMelDataset(Dataset):

def __init__(self, dataset_root: Path):
self.root = Path(dataset_root).expanduser()
speaker_dirs = [f for f in self.root.glob("*") if f.is_dir()]
speaker_dirs = []
for f in self.root.glob("*"):
if f.is_dir():
assert list(f.glob(
"*.npy")), "This folder NOT includes any npy data file."
speaker_dirs.append(f)

speaker_utterances = {
speaker_dir: list(speaker_dir.glob("*.npy"))
Expand Down

0 comments on commit 7d26f93

Please sign in to comment.