Repository navigation
Studio: say when an attached image is over the 20 MB limit - #14538
Conversation
…arness (#14545) Repo tests (CPU, rest) is red on main since #14516: 7 cases in `tests/test_optimized_precision_conflicts.py` fail with ``` unsloth/models/loader.py:1811: in from_pretrained _fp8_dequantize_config = _fp8_dequantize_quantization_config(model_config) E NameError: name '_fp8_dequantize_quantization_config' is not defined ``` The product is fine: `loader.py` imports the helper from `.loader_utils`. The test rebuilds `FastLanguageModel.from_pretrained` from source inside a hand-written namespace of stubs, and #14516 added a call that namespace did not have. Seen on #14538's run (job 119354809171). ## Change Instead of adding one more stub, the fixture now also loads the real definitions of the `.loader_utils` functions that `loader.py` imports and `from_pretrained` references, for any name it does not already stub. They are compiled with postponed annotations so signatures such as `Union[...]` do not need their typing imports. Existing stubs win, so every current fixture behaves as before; the next helper a PR adds to that import list is picked up without touching this test. For these fixtures the real `_fp8_dequantize_quantization_config` sees a config with no `quantization_config` and returns None, which is exactly what a non-fp8 checkpoint does. ## Testing - CPU torch 2.10, transformers 5.17: main 7 failed / 12 passed; this branch 19 passed. - Sabotage: making the real `_fp8_dequantize_quantization_config` raise fails the same 7 cases with that error, so they run the real helper rather than a stub.
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a51fd51e85
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
# Conflicts: # studio/frontend/scripts/check-bundle-budget.ts
… image in Compare One helper now owns the 20 MB limit and its message for both composers. Compare toasts each oversized image rather than only the first, reports a model that cannot take images before the size, and lets a paste of only an oversized image reach that toast instead of the generic paste error.
|
Pushed a review pass on top of your branch (merged current
Checked in a built Unsloth Studio: drop, paste and the file picker in both the single chat and Compare. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Done on 6afbdbe:
|
Lyxot
left a comment
There was a problem hiding this comment.
LGTM. Verified in a built Unsloth Studio; Codex converged and CI passed on a staging copy.
Picking or dropping an image larger than 20 MB in the chat composer did nothing. No chip appeared and no message explained why, so the file just seemed to vanish. The Compare composer skipped such an image silently too. Every other refusal in the same place (a PDF that is too large, a model that cannot see images, the MCP image limits) already shows a toast.
Both composers now show a toast naming the file and the 20 MB limit, the same way the other attachment checks report a refusal. Images under the limit attach as before.
Screenshots
A 27 MB PNG picked with a vision model loaded, in a normal chat and in Compare.