autodl(linux)环境下载git-lfs等工具及使用
一、git-lfs工具下载
#初始化git.lfs命令
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
git lfs install
二、 huggingface-cli工具下载及使用
Linux设置huggingface的镜像:
export HF_ENDPOINT=https://hf-mirror.com
pip install -U huggingface_hub
使用:
// 下载全部文件并保存到指定位置时,添加--local-dir参数,此时将保存至./Llama-2-13b-chat-hf/中
huggingface-cli download --resume-download meta-llama/Llama-2-13b-chat-hf --local-dir Llama-2-13b-chat-hf// 下载多个文件时,再添加具体文件名即可
huggingface-cli download meta-llama/Llama-2-13b-chat-hf config.json model-00001-of-00003.safetensors --local-dir Llama-2-13b-chat-hf// 下载多个文件并排除一些文件可使用--include和--exclude命令
huggingface-cli download meta-llama/Llama-2-13b-chat-hf --include "*.safetensors" --exclude "*.bin"// 需要 huggingface token 时 (Gated Repo),添加--token参数
huggingface-cli download meta-llama/Llama-2-13b-chat-hf --include "*.safetensors" --exclude "*.bin" --token hf_****