Include file path in audio loading error messages#4175
Open
Mr-Neutr0n wants to merge 1 commit intopytorch:mainfrom
Open
Include file path in audio loading error messages#4175Mr-Neutr0n wants to merge 1 commit intopytorch:mainfrom
Mr-Neutr0n wants to merge 1 commit intopytorch:mainfrom
Conversation
When torchaudio.load() fails, the error message now indicates which file was being loaded. This helps users diagnose issues when loading multiple files in batch processing pipelines. Fixes pytorch#3810
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/audio/4175
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Merge Blocking SEVsThere is 1 active merge blocking SEVs. Please view them below:
If you must merge, use This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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
torchaudio.load()fails on a file, the error message now includes the file path/URI that caused the failureload_with_torchcodec()for sample rate detection and audio decoding failures to include the URItorchaudio.load()that ensures any unexpected exception also surfaces the file pathFixes #3810
Test plan
torchaudio.load()with a non-existent file path and verify the error message includes the file pathtorchaudio.load()with a corrupted/invalid audio file and verify the error message includes the file pathtorchaudio.load()with a valid audio file and verify it still works correctlyload_with_torchcodec()that already contain the URI are not duplicated