Fix manifest reference path conversion#15842
Open
fallintoplace wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix NeMo-to-Lhotse manifest conversion so reference recordings keep their own manifest path instead of reusing the target path.
Root cause
convert_manifest_nemo_to_lhotse()loadeditem_reference_key, but the reference branch passeditem_target_keyinto_as_relative(). That made reference-only manifests crash with an unbound local and could serialize the wrong relative metadata when target and reference paths differed.What changed
item_reference_keyreference_filepathwithouttarget_filepathImpact
Reference-only manifests now convert successfully, and mixed target/reference manifests preserve the correct relative path metadata for both recordings.
Validation
uv run pytest tests/collections/audio/test_audio_datasets.py -k "convert_manifest_nemo_to_lhotse_with_reference_only or convert_manifest_nemo_to_lhotse_with_different_target_and_reference_paths" -vuv run pytest tests/collections/audio/test_audio_datasets.py -k "audio_to_target_with_reference_dataset" -vuv run --with black==24.10.0 black --check nemo/collections/audio/data/audio_to_audio_lhotse.py tests/collections/audio/test_audio_datasets.pyuv run isort --check-only nemo/collections/audio/data/audio_to_audio_lhotse.py tests/collections/audio/test_audio_datasets.py