文章目录
报错内容
提示:这里e couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like openai/clip-vit-base-patch32 is not the path to a directory containing a file named preprocessor_config.json.:
例如:这就说明你电脑不能访问hugging face。尝试过挂载vp{n} 没有得到解决。
提示:以下是本篇文章正文内容,下面案例可供参考
下面提供一个镜像地址: http://hf-mirror.com
方法一:使用huggingface 官方提供的 huggingface-cli 命令行工具。
(1) 安装依赖pip install -U huggingface_hub
(2) 基本命令示例:export HF_ENDPOINT=https://hf-mirror.comhuggingface-cli download --resume-download --local-dir-use-symlinks False bigscience/bloom-560m --local-dir bloom-560m
(3) 下载需要登录的模型(Gated Model)请添加–token hf_xxx参数,其中hf_xxx是 access token,请在huggingface官网这里获取。
示例:huggingface-cli download --token hf_*** --resume-download --local-dir-use-symlinks False meta-llama/Llama-2-7b-hf --local-dir Llama-2-7b-hf
方法二:使用url直接下载时,将 huggingface.co 直接替换为本站域名hf-mirror.com。
使用浏览器或者 wget -c、curl -L、aria2c 等命令行方式即可。下载需登录的模型需命令行添加 --header hf_xxx参数,token 获取具体参见上文。
方法三:(非侵入式,能解决大部分情况)
huggingface 提供的包会获取系统变量,所以可以使用通过设置变量来解决。
HF_ENDPOINT=https://hf-mirror.com python your_script.py
总结
提示:这里对文章进行总结:
欢迎关注我们的宫中皓,我们会分享更多坑!!!