Hugging Face
开始使用我们的git和 git-lfs界面
您可以从 CLI 创建存储库(如果您从网站创建了存储库,请跳过)
pip install huggingface_hub
You already have it if you installed transformers or datasets
huggingface-cli login
Log in using a token from huggingface.co/settings/tokens
Create a model or dataset repo from the CLI if needed
huggingface-cli repo create repo_name --type {model, dataset, space}
在本地克隆你的模型、数据集或空间
#Make sure you have git-lfs installed
#(https://git-lfs.github.com)
git lfs install
git clone https://huggingface.co/username/repo_name
然后添加、提交和推送你想要的任何文件,包括大文件
# save files via `.save_pretrained()` or move them here
git add .
git commit -m "commit from $USER"
git push
在大多数情况下,如果你使用其中一个兼容库,则可以通过其标识符从代码访问你的存储库: username/repo_name
例如对于 transformer 模型,任何人都可以使用以下方法加载它:
tokenizer = AutoTokenizer.from_pretrained("username/repo_name")
model = AutoModel.from_pretrained("username/repo_name")
作者:Jeebiz 创建时间:2023-12-11 19:47
最后编辑:Jeebiz 更新时间:2025-05-12 09:20
最后编辑:Jeebiz 更新时间:2025-05-12 09:20