Fixes issue: #3924 - #3929
Open
michaelsam94 wants to merge 1 commit into
Open
Conversation
Problem: invalid model ftype values reached ggml_ftype_to_ggml_type() and triggered GGML_ASSERT, aborting instead of returning a load error. Change: validate normalized hparams.ftype in whisper_model_load() before calling ggml_ftype_to_ggml_type(). Test: added test-model-load, which writes a minimal invalid model header with ftype = 5 and expects whisper_init_from_file_with_params() to fail cleanly. Verification I ran: git diff --check; direct compiled and ran test-model-load. CMake/CTest note: not run because cmake was unavailable in this environment.
danbev
approved these changes
Jul 28, 2026
danbev
left a comment
Member
There was a problem hiding this comment.
Thanks for the PR!
I think that we might need something similar in parakeet.cpp and perhaps we could add a function like ggml_ftype_is_supported to ggml in the future that both could use. This would avoid having to update this code when new types are added to ggml. But that is outside of the scope of this PR.
| } | ||
|
|
||
| whisper_context_params params = whisper_context_default_params(); | ||
| whisper_context * ctx = whisper_init_from_file_with_params(path, params); |
Member
There was a problem hiding this comment.
Perhaps we can add std::remove(path) directly after whisper_init_from_file_with_params, so that we just have one std::remove instead of one in both code paths?
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.
Problem: invalid model ftype values reached ggml_ftype_to_ggml_type() and triggered GGML_ASSERT, aborting instead of returning a load error.
Change: validate normalized hparams.ftype in whisper_model_load() before calling ggml_ftype_to_ggml_type().
Test: added test-model-load, which writes a minimal invalid model header with ftype = 5 and expects whisper_init_from_file_with_params() to fail cleanly.
Verification I ran: git diff --check; direct compiled and ran test-model-load.
CMake/CTest note: not run because cmake was unavailable in this environment.