Hugging Face上传自己的文件

在Hugging Face上传自己的模型和文件。

环境准备

1
2
3
4
5
6
7
8
# You already have it if you installed transformers or datasets
pip install huggingface_hub

# Log in using a token from huggingface.co/settings/tokens
huggingface-cli login

# Create a model or dataset repo from the CLI if needed
huggingface-cli repo create repo_name --type {model, dataset, space}
1
2
3
4
# Make sure you have git-lfs installed
# (https://git-lfs.github.com)
git lfs install
git clone https://huggingface.co/username/repo_name

上传文件

1
2
3
git add .
git commit -m "commit from $USER"
git push