赞
踩
huggingface普通下载会被墙
下载前先登录: huggingface-cli login
然后在python中运行代码(运行python文件不会显示进度条,将其复制粘贴到命令行中运行)
from huggingface_hub import snapshot_download
repo_id = "stabilityai/stable-diffusion-2-base" # "stabilityai/stable-diffusion-2-base"
local_dir = '/root/home/huggingface_model_dir/stable-diffusion-2-base'
cache_dir = local_dir + "/cache"
snapshot_download(cache_dir=cache_dir, local_dir=local_dir, repo_id=repo_id, local_dir_use_symlinks=False,
resume_download=True, allow_patterns=["*.model", "*.json", "*.bin", "*.py", "*.md", "*.txt"],
ignore_patterns=["*.safetensors", "*.msgpack", "*.h5", "*.ot", ], )
其中repo地址即为hugging face项目名
local_dir为项目保存地址
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。