Repository navigation
Studio: download files over 50GB from ModelScope over HTTPS (#15989) - #15994
Conversation
ModelScope's HF_ENDPOINT adapter does not serve Hugging Face Xet token endpoints (HTTP 405). Oversized GGUFs then fell through to HTTPS and hit huggingface_hub's 50GB ceiling with a misleading hf_xet install hint (unslothai#15989). Mark Xet unavailable while ModelScope is the source so Auto uses HTTPS for normal files and oversized jobs refuse with a switch-to-Hugging-Face message.
huggingface_hub's 50GB limit is a client-side check in http_get written for Hugging Face's storage; ModelScope's CDN serves these files, so refusing them left the download impossible rather than clearer. The ModelScope worker now lifts the check and the backend stops applying the ceiling while ModelScope is the source. Hugging Face behavior is unchanged.
|
I pushed a change that replaces the refusal with a working download, and merged latest Why: huggingface_hub's 50GB limit is a client-side check in What changed:
Checked against real ModelScope, without a full download: the real worker streamed that shard, was killed, then resumed from the same offset (macOS). Only the disk-space check was faked. No complete 110GB transfer has been run. The PR title still describes the old refusal. |
|
@codex review |
Codex Review SummaryThis 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. |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ 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". |
|
Review record for #15994, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#647. Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found. Round 1: reviewed mirror
|
Xet availability now depends on the source (ModelScope has none), so a verdict cached under one source must not answer for the other. [skip ci]
…16108) Since #16031 (test-launch sd.cpp binaries without the Windows missing-DLL box), the AV shapes lint finds a new error on main. Every PR's `Source lint` job and the `test_lint_av_shapes.py::test_the_repository_is_clean_against_its_baseline` test in the CPU shards fail on it, for example on #16018 and #15994: ``` studio/backend/tests/test_sd_cpp_probe_error_mode.py:221: [AV009] error: copies a Windows system binary line: shutil.copy(getattr(sys, "_base_executable", sys.executable), binary) 1 new error(s). ``` `test_a_real_binary_missing_its_dll_is_reported_unrunnable` copies `python.exe` into `tmp_path` as `sd-server.exe`, away from `pythonXY.dll`, and cuts `PATH` to System32. The result is a real PE whose loader fails with `STATUS_DLL_NOT_FOUND`, the same failure as an sd.cpp ROCm build without HIP. The lint's suggested replacement, `windows_console_stub.py`, links nothing and starts fine, so it cannot produce that failure. The copy has to stay. The lint documents this route for that case: the finding is recorded in `scripts/av_shapes_baseline.json` with the reason. The entry carries the digest of that one line, so any other copy in the file is still a new error. I did not use `--update`. It would also have pruned many unrelated stale entries across the baseline. This adds the one group (9 lines). The CI message also prints an AV010 warning for `.github/workflows/studio-tauri-smoke.yml:374` first, but warnings do not fail the check. With only this entry added, the test passes. ## Verification - `python scripts/lint_av_shapes.py`: `1 new error(s)` on main, `0 new errors` here. - `tests/security/test_lint_av_shapes.py::test_the_repository_is_clean_against_its_baseline`: fails on main on the AV009 line, passes here. The rest of the file passes (19 passed). - `--self-test` still passes, since the lint is unchanged.
…zoo 2026.10.10 (#16114) `pip scan-packages :: studio` (and `:: extras`) now fails on every PR whose closure resolves torch 2.15.0 (released 2026-10-28) or botocore 1.43.122 (released 2026-10-29), and `pip scan-packages :: hf-stack` on every PR that resolves unsloth-zoo 2026.10.10 (released 2026-10-28). Examples are #16109 and #15994 in staging: ``` Summary: 1 CRITICAL, 4 HIGH HIGH torch torch/_inductor/compile_worker/subproc_pool.py same matched code, file digest outside the pin HIGH torch torch/_inductor/standalone_compile.py same matched code, file digest outside the pin HIGH torch torch/_precompile.py 1 matched line(s) appended to a reviewed file CRITICAL torch torch/testing/_internal/common_utils.py the flagged code was rewritten HIGH torch torch/_vendor/quack/epilogue/library.py (new site) CRITICAL botocore botocore/httpsession.py the flagged code was rewritten ``` I read each site in the shipped file. For torch I checked the v2.15.0 sources against the wheel's pinned file digests, and for botocore I read the 1.43.122 wheel. | Site | What the scanner matched | Verdict | |---|---|---| | `torch/_inductor/compile_worker/subproc_pool.py` | `time.sleep(3600)` and `subprocess.Popen(` of the compile workers, byte-identical to the reviewed entry. Only the lines moved, so the pinned file digest changed. | benign, new pin | | `torch/_inductor/standalone_compile.py` | `exec(compile(python_code, "<compile_to_python>", "exec"), namespace)`, identical to the reviewed entry and one line lower. | benign, new pin | | `torch/_precompile.py` | The same `exec(compile(python_code, "<precompile>", "exec"), module_ns)`, plus one more commented usage example `# exec(open("this_file.py").read(), ns)`. | benign | | `torch/testing/_internal/common_utils.py` | The DOTALL reverse-shell pattern spans the file from `import socket` on L32, so any edit moves its digest; every torch release has had its own entry. The only socket use is `find_free_port`, which binds `localhost:0` and returns the port. "connect" appears only in error strings, and there is no `dup2`, `pty.spawn`, `/bin/sh` or `webbrowser`. | benign | | `torch/_vendor/quack/epilogue/library.py` (new) | `_gen_epi_fn` compiles and execs a generated epilogue `def`. `params` and `body` are fixed fragments chosen by boolean flags, and `activation` is only a key into a fixed map. The file documents the reason: the generated signature lets absent operands compile out of the kernel. Nothing external reaches the source. | benign | | unsloth-zoo `compiler.py` | One matched line was added: `compile(looped, "<peft lora forward>", "exec")` in `_patch_lora_update`. It checks that PEFT's own forward source still parses after a string replacement, then falls back if it does not. The code object is discarded and nothing is executed. The other matched lines are unchanged. | benign | | unsloth-zoo `llama_cpp.py`, `mlx/loader.py`, `mlx/speculative.py`, `temporary_patches/moe_utils.py`, `vllm_utils.py` | Byte-identical matched code. Only the pinned file digest moved. | benign, new pins | | `botocore/httpsession.py` | The env read is the opt-in `SSLKEYLOGFILE` TLS key log. The `conn.urlopen(...)` call gained `enforce_content_length=False` and an optional per-request timeout through `extra_kwargs`. | benign | ## Change I added the new entries (six for torch and botocore, six for unsloth-zoo) next to the existing ones for each file and removed nothing. The earlier entries stay, so shards that still resolve older torch and botocore are unaffected. I did not regenerate with `--write-baseline`: it writes only what the current scan sees, so a partial scan would have dropped every other package's entries. The pinned sites keep pins (`file_sha256`) at their new file digests. dnspython 2.9.1 also showed up in one run, but it scans clean on its own against this baseline, so it needs no entry. ## Verification - `scripts/scan_packages.py torch==2.15.0`: on main `1 CRITICAL, 4 HIGH` with exit 1, the same result as the CI runs. On this branch it exits 0. - `scripts/scan_packages.py botocore==1.43.122`: on main `1 CRITICAL` with exit 1. On this branch it exits 0. - `scripts/scan_packages.py unsloth-zoo==2026.10.10`: on main `1 CRITICAL, 5 HIGH` (the CI hf-stack result). On this branch it exits 0. - The tests that read the scanner or its baseline: 638 passed.
…load (#16130) ## Problem `Frontend build + bundle sanity` fails intermittently at the `Titlebar modal blur and window controls (Chromium)` step on unrelated PRs (seen on #15994, #16091 and the staging run for #16109). Every time it is the same shape: all modal checks pass, then the final `assert not errors` trips on ``` 504: http://127.0.0.1:5491/node_modules/.vite/deps/sonner.js?v=... 504: http://127.0.0.1:5491/node_modules/.vite/deps/zustand.js?v=... ``` with no page error logged. The smoke records every script, stylesheet or font response at 400 or above. When the Vite dev server re-optimizes its dependencies mid-load, it answers in-flight requests for the replaced pre-bundles with `504 Outdated Optimize Dep` and then reloads the page. That response is Vite's reload signal, not a missing asset, and the page checks after it pass. It depends on runner timing, so it does not reproduce on demand (a cold cache and the CI step order both passed locally). ## Fix - `tests/studio/_playwright_robust.py`: `is_vite_outdated_dep(response)` matches exactly status 504 with the status text `Outdated Optimize Dep`. Vite's other 504, `Optimize Deps Processing Error`, is a real failure and still counts. - `tests/studio/playwright_titlebar_blur.py`: the asset response guard skips only that response. A 404, a 500 or a processing-error 504 is still recorded and still fails the smoke. - `tests/studio/test_vite_outdated_dep.py` pins this: - the predicate's truth table; - that the smoke's guard keeps the exemption as a single `and not ...` term; - that the installed Vite still sends that status text, so a rename upstream shows up here instead of as a dead exemption. ## Verification - New tests pass (8 passed, the Vite source check included). - Sabotage: - With the predicate reduced to `status == 504`, two rows fail (the processing-error and gateway-timeout cases). - With the exemption removed from the smoke, the guard test fails. - In a real Chromium page served by a small HTTP server, Playwright reports `status_text == "Outdated Optimize Dep"` for the first response, and the predicate is true only there. It is false for `Optimize Deps Processing Error`. - `python3 tests/studio/playwright_titlebar_blur.py` passes with the change.
Summary
Fixes #15989
With ModelScope as the model source, any file over 50GB (for example
UD-IQ1_M/...-00005-of-00005.ggufinunsloth/DeepSeek-V4.1-Flash-1017-GGUF, 110.6GB) could not be downloaded. Studio's ModelScope adapter offers no Xet, and huggingface_hub refuses plain HTTPS transfers aboveMAX_HTTP_DOWNLOAD_SIZE(50GB). That limit is a client-side check inhttp_get, not a ModelScope limit: ModelScope's CDN answers range requests anywhere in the 110.6GB shard with a 206.constants.MAX_HTTP_DOWNLOAD_SIZE).Test plan
pytest studio/backend/tests/test_hub_download_http_size_ceiling.py: 51 passed on Linux, macOS and Windows; 4 of the new tests fail on the merge base.ValueError: The file is too large to be downloaded using the regular download method; head streams it, is killed, and resumes from the same offset.MAX_HTTP_DOWNLOAD_SIZEis read at call time in huggingface_hub 0.36.2, 1.32.0, 1.33.0 and 2.4.0.tests/download-transport-source-switch.test.ts(fails without the source-switch refresh), fullnpm testandnpm run buildpass.Before / after
Settings > General > Downloads with ModelScope as the model source (merge base 8cb9120 vs f6cc0c8). Before, Xet stays selectable and Auto claims Xet; after, Xet is disabled and Auto names HTTPS with the reason.