Allow HF endpoint override via HF_ENDPOINT env var#140
Open
yeruoforever wants to merge 1 commit intohuggingface:mainfrom
Open
Allow HF endpoint override via HF_ENDPOINT env var#140yeruoforever wants to merge 1 commit intohuggingface:mainfrom
yeruoforever wants to merge 1 commit intohuggingface:mainfrom
Conversation
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.
Summary
Allow
HF_ENDPOINTenvironment variable to be respected when using local cache for model/dataset updates.Motivation / Problem Statement
Currently, when users specify a custom Hugging Face endpoint via
HF_ENDPOINTenvironment variable for downloading models or datasets, this setting is not persisted or respected during subsequent cache operations.Scenario:
HF_ENDPOINT=https://hf-mirror.comto download a model from a mirror server~/.cache/huggingface/https://huggingface.coinstead of respecting the originally configuredHF_ENDPOINTThis breaks the expected behavior where users consistently want to use their specified mirror server for all Hugging Face Hub operations, including cache refresh and version updates.
Proposed Changes
Update endpoint resolution logic to read from environment variable with appropriate fallback: