mirror of
https://github.com/unslothai/unsloth.git
synced 2026-08-24 00:04:14 +00:00
* fix(studio): stop an unreachable hub from stalling the RAG embedder Naming the embedder's GGUF went straight to `list_repo_files`, which has no timeout parameter and whose pagination layer passes an explicit `timeout=None` that overrides any client-level default. `socket.create_connection` applies a connect timeout per address and races no address families, so on a host whose route to the hub blackholes that call blocks until the kernel exhausts its SYN retries — while `_lifecycle_lock` is held, so every reader queues behind it. Resolve from the local Hugging Face cache first. `_model_path` is per-process, so every restart previously paid a hub call to name a file already on disk; the cache answers in tens of milliseconds and never touches the network. Only the revision `refs/main` names is used, since that is what a download would serve, and a hit pins the embedder to it: `embedding_identity` does not record a revision, so silently adopting republished weights would leave a persisted index answering queries from one model with documents embedded by another. On a genuine miss the hub is still used, now under a wall-clock deadline and inside the same forced-offline-when-unreachable guard the chat GGUF path uses. If the hub cannot name a file, a cached GGUF of another variant is adopted with a warning rather than leaving the install with no embedder; a transfer that fails for its own reasons still surfaces. Fixes #8778 * fix(studio): bound the prebuilt release-freshness fetch `urlopen(timeout = 5.0)` looks capped, but `socket.create_connection` applies that timeout once per address as it walks the `getaddrinfo` results, and races no address families. A host whose leading addresses blackhole therefore pays five seconds for each one before reaching a working address, so the effective cost is the timeout multiplied by the address count rather than the timeout itself. `/api/inference/status` reads this fetch, so that multiplication becomes the route's response time. Failed lookups are only memoised for 60s, which is shorter than the stall itself, so back-to-back status reads each pay it again. Run the fetch under a wall-clock deadline. A missed deadline is a failure like any other: it feeds the existing failure cache and the last-good disk value, so the freshness banner fails open exactly as it already does offline. * fix(studio): keep cache-first embedder resolution faithful to the listing Review of the cache-first path surfaced four ways a local snapshot could answer differently from the full repo listing it stands in for. Companion-repository precedence is restored. A custom model resolves through its derived `-GGUF` companion first and reaches the model repo only when the companion has no GGUF; consulting the cache for both candidates let a file cached under the fallback pre-empt a companion the hub could still resolve, and then tagged it as current. The cache is now consulted for the preferred repo only, while the offline degrade still reaches both. Selection no longer depends on arrival order. A listing arrives ordered and a directory scan does not, so among equal-length names the tiebreak now falls back to the name itself; without it a complete cached shard set could yield shard 2, which lacks the metadata llama-server needs. Split sets are verified before use. A snapshot holding part of a set cannot serve it, so the winner is checked and, if unservable, dropped and the pick retried — failing the lookup outright would let an incomplete family shadow a complete one that merely sorts later. Verifying per winner rather than per file keeps this to a single sibling walk. MTP drafters join mmproj in the exclusion. A drafter is a companion rather than a model, and a cache subset holding only the companion was read as holding the embedder. Repo ids now resolve through `resolve_cached_repo_id_case`, so a repo id typed with different casing than its cache folder still finds its GGUF instead of re-downloading, or failing outright when the hub is unreachable. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| child_env.py | ||
| freshness_flow.py | ||
| llama_backend.py | ||
| runtime_libs.py | ||
| update_flow.py | ||
| whisper_layout.py | ||