linux服务器上传模型到huggingface

下载必要的依赖项
克隆库

pip install huggingface_hub
git lfs install
git clone https://huggingface.co/username/repo_name

若无管理员权限,安装lfs可使用命令:

wget https://github.com/git-lfs/git-lfs/releases/download/v3.2.0/git-lfs-linux-amd64-v3.2.0.tar.gz
tar -xzf git-lfs-linux-amd64-v3.2.0.tar.gz
PATH=$PATH:/<absolute-path>/git-lfs-3.2.0/
git lfs install
git lfs version

生成ssh的key

ssh-keygen -t ed25519 -C "email"

设置key存储的位置,自定义
打开文件,将文件中的key复制到hf中
在这里插入图片描述
配置成功后,输入

ssh -T git@hf.co 

会有欢迎的提示,证明配置成功

git remote set-url origin git@hf.co:<repo_path>

where <repo_path> is in the form of:

<user_name>/<repo_name> for models
datasets/<user_name>/<repo_name> for datasets
spaces/<user_name>/<repo_name> for Spaces

然后就可以上传文件了

git add .
huggingface-cli lfs-enable-largefiles dictionary_path
git commit -m "commit from $USER"
git push
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值