Reject quant values that cannot be applied - #19
Merged
Merged
Conversation
resolve_model_path only used quant when QUANT_REPOS had a build for the model; otherwise it quietly returned the full-precision repo, so LightningWhisperMLX(model="turbo", quant="4bit") loaded an unquantized model, and any string (e.g. "3bit") was accepted. It now raises ValueError for an unknown quant level, for a model with no quantized build (listing the ones that have one), and for quant combined with a full repo path. README and the LightningWhisperMLX docstring list the models with quantized builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TMXYMqgLAykqRApmbRfpTA
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.
What does this PR do?
Closes #9.
resolve_model_pathonly usedquantwhenQUANT_REPOShad a build for the model. Otherwise it quietly returned the full-precision repo, soLightningWhisperMLX(model="turbo", quant="4bit")loaded an unquantised model, and any string (e.g."3bit") was accepted.It now raises
ValueErrorin three cases:4bitand8bit)quantcombined with a full repo path (pass the quantised repo path asmodelinstead)An empty
quantstill means full precision. README and theLightningWhisperMLXdocstring list the models with quantised builds.Behaviour change: calls that used to silently fall back to full precision now raise.
How was this tested?
pytest): 73 passed, 1 skippedvayu audio.mp3)tests/test_utils.pycovers name and path resolution, every entry inQUANT_REPOS, and each rejection case, including throughLightningWhisperMLX. Four tests fail onmain.claude-reviewwill fail as on #12 (the repository'sCLAUDE_CODE_OAUTH_TOKENsecret, see this comment).🤖 Generated with Claude Code
https://claude.ai/code/session_01TMXYMqgLAykqRApmbRfpTA
Generated by Claude Code