Skip to content
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

Add missing audio_filepath validation for Canary #8119

Merged
merged 2 commits into from
Jan 3, 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
3 changes: 3 additions & 0 deletions nemo/collections/common/data/lhotse/nemo_adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ def __iter__(self):
tar_path = self.shard_id_to_tar_path[sid]
with tarfile.open(fileobj=open_best(tar_path, mode="rb"), mode="r|*") as tar:
for data, tar_info in zip(shard_manifest, tar):
assert (
data["audio_filepath"] == tar_info.name
), f"Mismatched JSON manifest and tar file. {data['audio_filepath']=} != {tar_info.name=}"
raw_audio = tar.extractfile(tar_info).read()
# Note: Lhotse has a Recording.from_bytes() utility that we won't use here because
# the profiling indicated significant overhead in torchaudio ffmpeg integration
Expand Down
Loading