Repository navigation
fix: name unsloth_vllm_standby parameter in vLLM standby error - #7089
Conversation
FastBaseModel.from_pretrained's vLLM-standby guard raised "UNSLOTH_VLLM_STANDBY is True, but UNSLOTH_VLLM_STANDBY is not set to 1", naming the environment variable in both clauses. The value that is True is the unsloth_vllm_standby parameter, not the env var, so the message was self-contradictory. Name the parameter in the first clause, matching the sibling guard in FastLlamaModel.from_pretrained. Signed-off-by: Anas Khan <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request corrects a self-contradictory error message in unsloth/models/vision.py where the unsloth_vllm_standby parameter guard incorrectly referred to the environment variable twice. It also introduces a new unit test to verify this behavior. The feedback suggests removing spaces around the = sign in a keyword argument within the new test file to adhere to PEP 8 style guidelines.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| path = os.path.join(os.path.dirname(__file__), os.pardir, "unsloth", "models", module_relpath) | ||
| with open(path, encoding = "utf-8") as f: | ||
| tree = ast.parse(f.read()) | ||
| for node in ast.walk(tree): |
There was a problem hiding this comment.
According to PEP 8, spaces should not be used around the = sign when used to indicate a keyword argument. Please remove the spaces around the = operator.
| for node in ast.walk(tree): | |
| with open(path, encoding="utf-8") as f: |
References
- PEP 8: Don't use spaces around the = sign when used to indicate a keyword argument or a default parameter value. (link)
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Triggered the guard live rather than trust the string: called Confirmed the new wording matches the already-correct sibling guard in The ast-based test was dropped in a later commit, which also moots gemini's PEP8 nit on it. @shimmyshimmer fine to merge from my side, LGTM. |
What
FastBaseModel.from_pretrained's vLLM-standby guard raises a self-contradictoryerror message. The guard is:
The value that is
Truehere is theunsloth_vllm_standbyparameter, whileUNSLOTH_VLLM_STANDBYis the environment variable that is not set to1. Themessage names the env var in both clauses, so it literally reads
"UNSLOTH_VLLM_STANDBY is True, but UNSLOTH_VLLM_STANDBY is not set to 1", which
points the user at the wrong thing.
The sibling guard in
FastLlamaModel.from_pretrained(
unsloth/models/llama.py) already words the same check correctly (parameter inthe first clause, env var in the second). This aligns
vision.pywith it.Change
unsloth/models/vision.py- one line, message text only:No behavior change: the guard condition is untouched, only the message string
changes.
Test
Adds
tests/test_vllm_standby_error_message.py. It parses the guard's raisedstring out of the source with
ast(following the source-parsing precedent intests/test_loader_glob_skip.py) so it needs no GPU or model download, andasserts:
vision.pymessage names theunsloth_vllm_standbyparameter and nolonger claims the env var is the
Truevalue, andvision.pyandllama.pyguards name both the parameter and the env var,keeping the two in sync.