Repository navigation
Show loadable Hugging Face snapshots from custom folders in Select Model - #17673
Conversation
Codex Review Summary: ✅ CompletedThis 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. |
A local directory load picks the GGUF before Transformers, so the separate Safetensors row of a snapshot holding both formats loaded the GGUF. With one row per load path the option keys need no inventory id, which also keeps the selected-row lookup working. [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6afbeb90ad
ℹ️ 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".
| // A partial GGUF has no file linked into the snapshot yet, so the directory load skips it. | ||
| .filter((row) => row.modelFormat === "gguf" && !row.partial) |
There was a problem hiding this comment.
Include payload-bearing partial GGUF rows in the format guard
If an inactive-cache snapshot contains complete Safetensors weights plus a finished shard from a cancelled split-GGUF download, its GGUF row is partial even though that shard is already linked into snapshots/. The new !row.partial condition provides a counterexample to the earlier format-selection fix: detect_gguf_model() still returns that shard when no complete GGUF alternative exists. Consequently, the picker offers the Safetensors row, but selecting its directory dispatches to GGUF and fails instead of loading the usable Safetensors weights. Distinguish manifest-only partial rows from rows with actual GGUF files, or provide a format-aware load target.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not changing this here. It needs a mixed repo in an inactive cache plus a cancelled split-GGUF download that already linked one shard; the load then errors (no wrong model), where the merge base offered nothing. The cause is detect_gguf_model falling back to a torn shard when no whole split exists, which hits any custom folder holding Safetensors plus a torn shard today, so it belongs in the loader, not in this picker filter.
|
Codex Review: Didn't find any major issues. Another round soon, please! 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/src/features/model-picker/components/model-selector/pickers.tsx [skip ci]
An active-cache GGUF copy of the same repo made dedupe drop the custom snapshot's GGUF row, which unhid its Safetensors row although the directory load still picks the GGUF.
|
Codex Review: Didn't find any major issues. What shall we delve into next? 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". |
…narios run on main again (#17816) ## Summary `tests/studio/test_chat_autoload_failure_gate.py` has failed 85 of 86 scenarios on `main` since #17673 ("Show loadable Hugging Face snapshots from custom folders in Select Model"). It shows up in `Repo tests (CPU, studio)`, first on the staging run of #16717: ``` tests/studio/test_chat_autoload_failure_gate.py:950: in _build_harness E AssertionError: the sliced region uses ['isOtherCacheSnapshot'], imported by chat-adapter.ts but absent from this harness. Add a stub to PREAMBLE, or these scenarios will fail as wrong-model assertions ``` #17673 is correct. `isAutoLoadableLocalRow` now admits another cache's snapshot rows through `isOtherCacheSnapshot` (from `features/model-picker/inventory/local-cache-snapshot.ts`). The harness slices that region of `chat-adapter.ts` and supplies its imports itself, and its import guard flagged the new name as intended. ## Change (test only) The harness now inlines the shipped `isOtherCacheSnapshot`, plus the `looksLikeLocalPath` it calls, read from source. It already inlines `server-model-wait.ts` and `load-request.ts` the same way. A hand-written stub would let the scenarios drift from the rule auto-load actually applies. If the function stops being a top-level `export function`, the extraction asserts and names the file. ## Verification | | `test_chat_autoload_failure_gate.py` | |---|---| | main (`04ce4572`) | 85 failed, 1 passed | | this branch | 86 passed | Every `tests/studio` file that reads `chat-adapter.ts` (16 files): 446 passed.
When a registered custom folder contains a Hugging Face cache, Models Hub can list complete local snapshots that Select Model omits. This happens when the folder is outside the active cache and the snapshot must be loaded by path.
Include chat-capable snapshots with a local load path after shared inventory deduplication. Keep partial downloads and companion-prefetch rows out of the picker. Give GGUF and Safetensors entries distinct row keys when they share a load path.
Verification
fixture/Restored-STwent from zero to 12 matches. A GGUF entry was also recovered.Before / after on Linux (merge base vs PR head)
Two isolated Studio installs, an empty active Hugging Face cache, and one registered custom folder holding a Hugging Face cache with
fixture/Restored-GGUF(GGUF) andfixture/Restored-ST(Safetensors). Both builds list both snapshots in/api/hub/localwithactive_cache: false. Select Model > On Device lists none of them on the merge base, and listsfixture/Restored-GGUFunder Local models on this branch. The Safetensors row stays hidden because this host has no GPU, so the chat-only gate applies, as it does for any other local Safetensors folder. Picking the GGUF row resolved its variant list (Q4_K_M) and sent/api/inference/loadthe custom-folder snapshot path, which then loaded through llama-server.