【已解决】git无法执行“git clone https://huggingface.co/h94/IP-Adapter”
·
问题出现
在clone项目InstantStyle的时候,执行以下命令
git clone https://github.com/InstantStyle/InstantStyle.git cd InstantStyle # download the models git lfs install git clone https://huggingface.co/h94/IP-Adapter mv IP-Adapter/models models mv IP-Adapter/sdxl_models sdxl_models
执行到 “git clone https://huggingface.co/h94/IP-Adapter”开始报错,无法连接
问题原因
huggingface服务器不在国内,需要科学上网
问题再次出现
科学上网后,仍然报错,但是会发现报错的提示词不同,大概是说端口不正确
解决
这里用win10演示
查看端口号
打开“设置 -> 网络和Internet -> 代理”,记录下当前的端口号

输入代码
git config --global http.proxy 127.0.0.1:<你的端口号>
git config --global https.proxy 127.0.0.1:<你的端口号>
如我的端口号是20087,分别输入
git config --global http.proxy 127.0.0.1:20087
git config --global https.proxy 127.0.0.1:20087
刷新DNS
cmd运行下方代码,以刷新DNS缓存
ipconfig/flushdns
之后就可以正常git了
注意
如果你也是要clone这个
git clone https://huggingface.co/h94/IP-Adapter
因为包特别大,2.0Gb,所以会一直不动(但是不会报错),实际上是在下载的,并不是没有设置成功
更多推荐
所有评论(0)