Repository navigation
fix(cli): validate audio paths before loading models - #3939
Merged
LauraGPT merged 1 commit intoNov 23, 2026
Merged
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
The CLI checks audio paths only after constructing
AutoModel. A typo or directory argument can therefore trigger model initialization/downloads (or fail there) before the existing file-not-found error is reached.Validate every audio path just after argument parsing. The same error message and exit status are retained. For a batch with a missing later file, fail before loading a model, transcribing earlier files or creating the output directory.
Found through source inspection; reproduced with the existing CLI test harness.
Type of change
Validation
python -m compileall -q funasr examples testspasses. Python emitted two existing invalid-escape SyntaxWarnings in the untouchedexamples/industrial_data_pretraining/fun_asr_nano/tools/format5res.py.Validated on macOS, Python 3.12.13, PyTorch/torchaudio 2.10.0, CPU. Tests substitute the model loader; no model weights were downloaded and no inference-accuracy claim is made. The full repository suite, GPU and native Windows were not run.
git diff --checkpasses.User impact
CLI callers with missing files or directory arguments receive the existing actionable error without starting model work or partially processing a batch.
Notes for reviewers
The three parameterized cases cover a missing file, a directory and a missing later input; they also check that no model is constructed and no output directory appears.
Prepared and verified with Codex assistance. No independent human review is claimed.