download: honour HF_ENDPOINT in the curl path - #753
Open
gaook wants to merge 1 commit into
Open
Conversation
The official Hugging Face CLI already reads HF_ENDPOINT, so the pro-*, glm-*,
and ds4f-mxfp4 targets can already be pointed at a mirror. The curl path used
by the smaller DeepSeek Flash GGUFs hardcoded huggingface.co, so the two
downloaders disagreed and the most commonly downloaded files (ds4f-q2 and
friends) could not use one.
Read the same variable in the curl path and in the two progress messages, so
both downloaders resolve to the same host. Unset behaviour is unchanged:
${HF_ENDPOINT:-https://huggingface.co} still yields the current URL.
This matters where huggingface.co is slow or unreachable; an 81GB download
over a mirror is the difference between a working and a non-working setup.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Problem
download_model.shhas two download paths, and they disagree about which host to use.The
pro-*,glm-*, andds4f-mxfp4targets go through the official Hugging Face CLI, which already readsHF_ENDPOINT, so those can be pointed at a mirror today. The curl path used for the smaller DeepSeek Flash GGUFs hardcodeshuggingface.co, so exactly the targets most people download —ds4f-q2and friends — cannot use one.Where
huggingface.cois slow or unreachable, an 81 GB download is the difference between a working and a non-working setup, and there is currently no way to redirect it short of editing the script.Change
Read the same
HF_ENDPOINTvariable in the curl path and in the two "from ..." progress messages, so both downloaders resolve to the same host. Also document it in theEnvironment:help block next toDS4_GGUF_DIR.Unset behaviour is unchanged:
${HF_ENDPOINT:-https://huggingface.co}yields the current URL, so no existing invocation changes.3 substituted lines + 4 lines of help text. No inference code touched.
Testing
Machine: MacBook Pro M5 Max, 128 GB, macOS 26.4, Metal backend.
Model quant:
ds4f-q2(...chat-v2-imatrix-0731.gguf, 80.76 GiB).ds4f-q2target throughHF_ENDPOINT=https://hf-mirror.comwith this patch applied: completed in one attempt, and the resulting file is byte-exact against the sizehuggingface.coreports (86720111488)../ds4 --inspectreports the expected 43 layers / 1328 tensors / 284.33 B parameters, and./ds4 -p ... --nothinkgenerates correctly.https://huggingface.co/...(default preserved).sh -n download_model.shclean;./download_model.sh --helprenders the newEnvironment:entry.No correctness or speed regression tests were run, as the change is confined to the download shell script and cannot affect any inference backend.