Repository navigation
don't answer a bad model path from the cache - #174
Merged
Merged
Conversation
Greptile SummaryThe PR prevents invalid explicitly configured model paths from being silently replaced by cached or automatically downloaded checkpoints.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| sdk/src/unplug/core/runtime/model_runtime.py | Stops auto-download from replacing a named invalid checkpoint and reports the offending path when ML is required. |
| sdk/src/unplug/ml/store.py | Restricts cache fallback to specifications without an explicit or environment-provided checkpoint path. |
| sdk/tests/unit/ml/test_model_store.py | Adds isolated regression coverage for explicit paths, environment overrides, cache resolution, auto-download, and required-ML errors. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Resolve active model specification] --> B{Explicit or environment path set?}
B -->|Yes| C{Valid checkpoint?}
C -->|Yes| D[Load configured checkpoint]
C -->|No| E[Preserve unusable path]
E --> F{ML required?}
F -->|Yes| G[Fail model setup]
F -->|No| H[Continue with degraded ML coverage]
B -->|No| I{Cached checkpoint available?}
I -->|Yes| J[Load cached checkpoint]
I -->|No| K{Automatic download enabled?}
K -->|Yes| L[Download catalog tier]
K -->|No| F
Reviews (3): Last reviewed commit: "name the rejected path in the require_ml..." | Re-trigger Greptile
SDK Coverage •
|
||||||||||||||||||||||||||||||||||||||||
7 of 8 tasks
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.
Closes #149.
resolve_spec_pathfell through toresolve_local_path(tier)whenever the configured checkpoint failed validation, so a pinned path that went missing was answered with whatever the cache held, silently.require_ml=Truedid not help, because the substituted model satisfied it.The cache is now only consulted when nobody named a checkpoint. An explicit
pathorUNPLUG_MODEL_PATHthat is unusable stays unusable and warns, and the caller decides what happens next: download it whenauto_download_modelis set, degrade whenrequire_mlis false, raise when it is true. Auto-download is unaffected, since it already runs after this and keys off the same validity check.Three tests. They build a populated cache under
tmp_pathrather than relying on the machine having model weights, so they fail on a runner too. Revertingstore.pyturns four tests red, including the two on dev that were passing in CI for the wrong reason.