Skip to content

[Hackathon 7th] 修复不存在 *.npy 文件的空文件夹导致的数据遍历错误 #3948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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