Skip to content

Reject quant values that cannot be applied - #19

Merged
CodeWithBehnam merged 1 commit into
mainfrom
claude/lucid-franklin-gsu7v4
Sep 30, 2026
Merged

CodeWithBehnam merged 1 commit into
mainfrom
claude/lucid-franklin-gsu7v4

Conversation

@CodeWithBehnam

Copy link
Copy Markdown
Owner

What does this PR do?

Closes #9.

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 unquantised model, and any string (e.g. "3bit") was accepted.

It now raises ValueError in three cases:

  • an unknown quant level (the message lists 4bit and 8bit)
  • a model with no quantised build (the message lists the models that have one)
  • quant combined with a full repo path (pass the quantised repo path as model instead)

An empty quant still means full precision. README and the LightningWhisperMLX docstring list the models with quantised builds.

Behaviour change: calls that used to silently fall back to full precision now raise.

How was this tested?

  • Tested with audio file(s)
  • Ran existing tests (pytest): 73 passed, 1 skipped
  • Tested CLI (vayu audio.mp3)

tests/test_utils.py covers name and path resolution, every entry in QUANT_REPOS, and each rejection case, including through LightningWhisperMLX. Four tests fail on main.

claude-review will fail as on #12 (the repository's CLAUDE_CODE_OAUTH_TOKEN secret, see this comment).

🤖 Generated with Claude Code

https://claude.ai/code/session_01TMXYMqgLAykqRApmbRfpTA


Generated by Claude Code

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
@CodeWithBehnam
CodeWithBehnam merged commit 67f499d into main Sep 30, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quant is silently ignored for models without a quantised repo

2 participants