Warn when an acoustic model directory has no feat.params - #494
Open
lenzo-ka wants to merge 1 commit into
Open
Conversation
A model directory lacking feat.params was accepted silently, and the front end was built from caller-supplied values plus generic defaults. That can produce a feature recipe that does not match the model's training while initialization and decoding still appear successful. Emit a warning during model configuration expansion when hmm is set and no feature parameter file is available, naming the directory. This is deliberately a warning, not an error: a caller may legitimately supply the complete front-end configuration itself. No other behavior change. test_featparams asserts that a model shipping feat.params loads without the warning, and that a copy of the same model stripped of feat.params initializes with the warning and a null effective featparams. The stripped case fails against the previous implementation.
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.
A model directory lacking
feat.paramswas accepted without any diagnostic. The front end is then built from caller-supplied values plus generic defaults (transform=legacy,nfilt=40,nfft=0,lifter=0), which can silently produce a feature recipe that does not match the model's training while initialization and decoding still appear successful. For scale, the shipped en-us model's own file specifies-nfilt 25,-transform dct, and-lifter 22.PocketSphinx cannot infer the training-time front end from the acoustic parameter files, so it cannot validate the configuration. It can, however, observe that a model directory was supplied and no feature parameter record exists. This change emits one warning during model configuration expansion in exactly that case, naming the directory and stating that the front end will be built from defaults plus caller-supplied configuration. It is deliberately a warning, not an error: a caller may legitimately supply the complete front-end configuration itself. No other behavior changes.
The new unit test
test_featparamsasserts that a model shippingfeat.paramsloads without the warning, and that a copy of the same model with the file removed initializes with the warning and a null effectivefeatparams. The stripped case fails against the previous implementation.Fixes #497
Tested on macOS (Apple clang) and Linux x86-64 (GCC 13.3); full unit and regression suite passes on both.