Repository navigation
Studio: guard export operations when the Hub is unreachable - #11466
Merged
Merged
Conversation
Member
|
Confirmed the export dispatch in studio/backend/core/export/worker.py is still outside the offline window that load and activation already use, and that the guard stays inert when the endpoint is reachable. Will get this reviewed. |
A push needs the Hub, so pinning the whole export offline after a failed probe only guarantees the push fails with huggingface_hub's misleading "unset HF_HUB_OFFLINE" error and prevents recovery if connectivity returns mid-export. Local exports keep the per-export window. The regression test now intercepts httpx.HTTPTransport, below the request hook where huggingface_hub 1.x enforces offline mode; stubbing httpx.Client.send bypassed that hook and failed every case. It also covers the push path, asserts the exact probe count, and isolates worker-process globals.
Collaborator
|
Pushed a follow-up commit (118aa20) and merged latest What changed:
Known limitation (left for a separate change): inside a local export's offline window, the first compressed-tensors (FP8/NVFP4) export can't provision llm-compressor-main when the Hub is unreachable but PyPI is reachable. |
Collaborator
|
Staging check for head
|
shaojun
pushed a commit
to shaojun/unsloth
that referenced
this pull request
Sep 29, 2026
…i#11466) Each local export command now runs in the export worker's offline window: it re-probes Hub reachability per export and, when unreachable, forces HF offline for that export and restores the previous state afterwards. This fixes the no-network export crash in transformers' _patch_mistral_regex -> model_info() (unslothai#6817). Hub-push exports skip the window, since a push needs the Hub. Regression tests cover a local disconnect and recovery and a push that is not pinned offline.
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.
Export commands can still consult the Hub after the checkpoint-loading offline window has ended. If connectivity drops between loading and exporting, merge/save metadata requests run without that protection.
Wrap each export command in the existing offline window so it checks connectivity for that operation and restores the previous state afterward, including when export fails.
Supersedes #7065 with only the remaining export change. Also follows the export-window approach in @InfoSage05’s #6861. The broader model-selection, RAG, and GGUF metadata changes are omitted because current main already handles those paths.
Validation: 70 targeted tests passed, 1 skipped. Eight new regression cases cover base, merged, GGUF, and LoRA command dispatch through disconnect, recovery, and export failure; all eight fail on the base revision and pass with this change. These use a stub export backend with real Hub client calls and intercepted HTTP transport. The unrelated MCP policy test was excluded because fastmcp is absent locally. Full GPU merged/GGUF export was not exercised.