huggingface如何使用ssh命令,下载数据集或者模型 比如:git clone git@hf.co:openchat/openchat_8192

本文介绍了在Linux服务器上通过SSH下载Huggingface模型或数据集的步骤,包括生成新的SSH密钥对,将公钥添加到Huggingface个人设置中,以及测试SSH连接的成功。用户需要访问Huggingface个人设置,创建SSHkey,并将生成的公钥内容粘贴到Huggingface网站上,然后通过ssh-Tgit@hf.co命令验证连接。
摘要由CSDN通过智能技术生成

今天抽空整理了一下笔记。
#linux服务器中,使用ssh下载huggingface模型或者数据集
1.访问huggingface个人主页(profile)里的settings
https://huggingface.co/settings/profile
2.点击左侧:SSH AND GPG keys
先开始准备工作:
准备工作:https://huggingface.co/docs/hub/security-git-ssh#generating-a-new-ssh-keypair
准备public key
以下是linux命令
1)先检查linux服务器是否有ssh: 输入 ssh -V
会返回类似:OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021
说明已经安装ssh
2)ssh-keygen -t ed25519 -C “自己的邮箱”
我的输入:ssh-keygen -t ed25519 -C 1335185@qq.com
返回如下:
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/zhangjing/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):(密码随意设置为:l20238)
Enter same passphrase again:(再输入一遍密码即可)

同时返回生成公钥和私钥的地址:
Your identification has been saved in /home/zhangjing/.ssh/id_ed25519 (私钥)
Your public key has been saved in /home/zhangjing/.ssh/id_ed25519.pub (公钥)

3)编辑公钥地址,获取公钥内容。复制公钥内容。
命令:vi /home/zhangjing/.ssh/id_ed25519.pub
public文件打开,然后复制内容

这个时候准备工作已经完成。

可以切换到huggingface网页开始2.SSH AND GPG keys 页面右侧
Add a SSH key
Key name (可以随意写:比如my_linux)
SSH Public key (把复制的public内容,粘贴进去即可)

3.最后检查ssh连接huggingface是否成功:
输入:ssh -T git@hf.co
在输入密码:l20238
最后返回:Hi zhangjing, welcome to Hugging Face.

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值