Skip to content

Fix manifest reference path conversion#15842

Open
fallintoplace wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
fallintoplace:fix/manifest-reference-key
Open

Fix manifest reference path conversion#15842
fallintoplace wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
fallintoplace:fix/manifest-reference-key

Conversation

@fallintoplace

Copy link
Copy Markdown

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() loaded item_reference_key, but the reference branch passed item_target_key into _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

  • route the reference path override through item_reference_key
  • add a regression test for manifests that have reference_filepath without target_filepath
  • add a regression test for manifests whose target and reference paths are both present and intentionally different

Impact

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" -v
  • uv run pytest tests/collections/audio/test_audio_datasets.py -k "audio_to_target_with_reference_dataset" -v
  • uv run --with black==24.10.0 black --check nemo/collections/audio/data/audio_to_audio_lhotse.py tests/collections/audio/test_audio_datasets.py
  • uv run isort --check-only nemo/collections/audio/data/audio_to_audio_lhotse.py tests/collections/audio/test_audio_datasets.py

@copy-pr-bot

copy-pr-bot Bot commented Jun 27, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants