服务器配置Huggingface并git clone模型和文件
参考:https://huggingface.co/welcome
1 注册hugging face
官网注册,并获取token【https://huggingface.co/settings/tokens】,用于登录
2 安装
2.1 安装lfs
https://stackoverflow.com/questions/48734119/git-lfs-is-not-a-git-command-unclear
(1)unbuntu 服务器
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
(2)Macos
brew update
brew install git-lfs
(3)Windows
下载程序安装:https://github.com/git-lfs/git-lfs/releases
2.2 安装huggingface_hub
pip install huggingface_hub
3 服务器登录huggingface
(1)方法一
终端输入命令
huggingface-cli login
输入token后回车确认
(2)方法二
python -c "from huggingface_hub.hf_api import HfFolder; HfFolder.save_token('MY_HUGGINGFACE_TOKEN_HERE')"
4 下载
git clone https://huggingface.co/username/repo_name
如果以上办法行不通,就从往网站上一个一个的下载文件。