Skip to content

fix: add missing return in load_model_with_fallback#235

Closed
benaskins wants to merge 1 commit intowaybarrios:mainfrom
benaskins:fix/load-model-return
Closed

fix: add missing return in load_model_with_fallback#235
benaskins wants to merge 1 commit intowaybarrios:mainfrom
benaskins:fix/load-model-return

Conversation

@benaskins
Copy link
Copy Markdown

When mlx_lm.load() succeeds on the happy path (no ValueError), the function falls through to implicit return None instead of returning the loaded (model, tokenizer) tuple.

This causes a TypeError in LLMModel.load():
TypeError: cannot unpack non-iterable NoneType object

The bug only affects models that load successfully without needing the tokenizer or strict=False fallback paths (which do have return statements).

When mlx_lm.load() succeeds on the happy path (no ValueError),
the function falls through to implicit return None instead of
returning the loaded (model, tokenizer) tuple.

This causes a TypeError in LLMModel.load():
  TypeError: cannot unpack non-iterable NoneType object

The bug only affects models that load successfully without
needing the tokenizer or strict=False fallback paths (which
do have return statements).
@benaskins
Copy link
Copy Markdown
Author

Closing. Dup of PR #230

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.

1 participant