lms
lms copied to clipboard
How to configure the download url prefix of https://huggingface.co.
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.
(cc: @wauplin for viz)
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).
+1
+1