注册 Hugging Face 后的官网创建模型的教程

本文介绍了如何通过HuggingFaceHub网站创建模型和数据集仓库,利用Python客户端库进行程序化访问,包括从命令行界面操作、安装GitLFS、克隆仓库、提交大文件以及通过兼容库加载预训练模型的示例。
摘要由CSDN通过智能技术生成

Welcome

Create a new model

From the website

Hub documentation

Take a first look at the Hub features

Programmatic access

Use the Hub’s Python client library

Getting started with our git and git-lfs interface

You can create a repository from the CLI (skip if you created a repo from the website)

 
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}
					

Clone your model, dataset or Space locally

 
Make sure you have git-lfs installed
					
(https://git-lfs.github.com)
					
git lfs install
					
git clone https://huggingface.co/username/repo_name
				

Then add, commit and push any file you want, including larges files

 
 save files via `.save_pretrained()` or move them here
						
git add .
						
git commit -m "commit from $USER"
						
git push
					

In most cases, if you're using one of the compatible libraries, your repo will then be accessible from code, through its identifier: username/repo_name

For example for a transformers model, anyone can load it with:

					tokenizer = AutoTokenizer.from_pretrained("username/repo_name")
					model = AutoModel.from_pretrained("username/repo_name")
				
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值