报错git解决:remote: Password authentication in git is no longer supported. You must use a user access to
我再git push 时候,需让我登录用户名、密码,输入后,报错说git不在支持Huggingface的账号密码认证了,需要token。
·
报错git解决:remote: Password authentication in git is no longer supported. You must use a user access token or an SSH key instead.
我的情况
我再git push 时候,需让我登录用户名、密码,输入后,报错说git不在支持Huggingface的账号密码认证了,需要token
原因:
Huggingface上现在不支持密码认证了,需要token认证。这是2023年,8月发生的变更!!Hub 上的 Git 操作不再支持使用密码验证
Huggingface 的 token 获取办法
头像——setting——access token——生成一个token
解决:
在终端中输入下面的远程设置,其中username、repository、token改为自己的
下面的git remote set-url origin 是用来设置你要上传的远程仓库的 URL地址,
git remote set-url origin https://ricky7372:<token>@huggingface.co/ricky7372/internlm-LLamaindex-streamlit
注意!!我这里报错了!!
fatal: unable to access 'https://huggingface.co/ricky7372/internlm-LLamaindex-streamlit/': Received HTTP code 503 from proxy after CONNECT
原因是服务器上没有代理,所以我不能用Huggingface.co 的 网址!!需要用镜像
把上面的命令中的 huggingface.co 换成 hf-mirror.com ,下面的命令
git remote set-url origin https://ricky7372:<token>@hf-mirror.com/ricky7372/spaces/internlm-LLamaindex-streamlit
#改为下面这个
git remote set-url origin https://hf-mirror.com/ricky7372/spaces/internlm-LLamaindex-streamlit
方式2:用huggingface-cli login 登录
还有一个种方式,直接用token当做密码来登录。
huggingface-cli login
会让我们粘贴密码,把token粘贴过去就好了
更多推荐
所有评论(0)