lms icon indicating copy to clipboard operation
lms copied to clipboard

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

Open liudonghua123 opened this issue 1 year ago • 4 comments

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.

liudonghua123 avatar Nov 20 '24 07:11 liudonghua123

(cc: @wauplin for viz)

julien-c avatar Nov 20 '24 09:11 julien-c

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://github.com/lmstudio-ai/lms/blob/2a9cb76f1191e4a5ee42f2f26e847a4d519f5427/src/subcommands/importCmd.ts#L669

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).

Wauplin avatar Nov 20 '24 10:11 Wauplin

+1

happyeddie avatar Dec 04 '24 07:12 happyeddie

+1

almas avatar Feb 26 '25 05:02 almas