Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to configure the download url prefix of https://huggingface.co. #104

Open
liudonghua123 opened this issue Nov 20, 2024 · 3 comments
Open

Comments

@liudonghua123
Copy link

Hi, I couldn't connect https://huggingface.co, but I still can download models from some mirror site like https://hf-mirror.com/ via configure env HF_ENDPOINT=https://hf-mirror.com when using huggingface-cli.

I tried configured env HF_ENDPOINT=https://hf-mirror.com, but it didn't help when download models.

Maybe add such feature would be nice.

@julien-c
Copy link

(cc: @Wauplin for viz)

@Wauplin
Copy link

Wauplin commented Nov 20, 2024

Hey there, thanks for the ping :)

What we usually do in the HF ecosystem is indeed to respect the HF_ENDPOINT environment variable whenever we need to make a call to the Hub. For example, this would be the case when searching models here:

`https://huggingface.co/api/models?search=${encodeURIComponent(term)}&full=true&sort=likes`,

I haven't found in the codebase where the files are actually downloaded but same for that one, it would be best to replace https://huggingface.co by HF_ENDPOINT (when provided).

Been able to set a custom endpoint can be useful in locations where the main website is not accessible (typically to access https://hf-mirror.com or a private mirror in companies for security reasons). Here is where the environment variable is handled in huggingface_hub (for lms, no need for the staging thingy).

@happyeddie
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants