方法一:下载到本地,load模型时使用下载到项目中的路径
方法二:使用huggingface_hub
pip install -U huggingface_hub
linux export HF_ENDPOINT=https://hf-mirror.com
windows $env:HF_ENDPOINT = "https://hf-mirror.com"
方法三:临时脚本设置
import os
os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'
from datasets import load_dataset
dataset = load_dataset("数据集名称")
hugging face本地下载
- 设置cache路径
export HUGGINGFACE_HUB_CACHE="data/xxx/.cache"
- 设置下载路径,使用huggingface-cli下载
pip install huggingface-cli
huggingface-cli download Qwen/Qwen3-VL-2B-Instruct --local-dir <model_path>(不需要引号)
下载全部文件添加--resume-download参数
huggingface-cli download --resume-download facebook/sam3 --local-dir <model_path>
参考
https://blog.csdn.net/lanlinjnc/article/details/136709225
https://blog.csdn.net/yyh2508298730/article/details/137773125
1万+

被折叠的 条评论
为什么被折叠?



