网站建设公司专业开发北京网站,vps小学生,唐山手机网站建设,百度一下就知道官网huggingface是一个网站#xff0c;类似于github#xff0c;上面拥有众多开源的模型、数据集等资料#xff0c;人工智能爱好者可以很方便的上面获取需要的数据#xff0c;也可以上传训练好的模型#xff0c;制作的数据集等。本文只介绍下载模型的方法#xff0c;适合新手入… huggingface是一个网站类似于github上面拥有众多开源的模型、数据集等资料人工智能爱好者可以很方便的上面获取需要的数据也可以上传训练好的模型制作的数据集等。本文只介绍下载模型的方法适合新手入门更多内容详情参考Download files from the Hub 方法一、
进入Hugging Face – The AI community building the future. 在搜索框中输入要要下载的模型以bert为例输入bert 显示[Models]意思是模型下面是bert相关的模型选择[bert-base-uncased]进入页面 点击红框中的[Files and versions]跳转到下载页面 手动点击图中红框标记下载图标一个一个下载保存到一个文件夹。 方法二、 同方法一类似进入huggingface获取模型仓库id [bert-base-uncased]红框中标注。
pip install huggingface_hubfrom huggingface_hub import snapshot_downloadsnapshot_download(repo_idbert-base-uncased)
下载bert-base-uncased模型
pip install huggingface_hubfrom huggingface_hub import snapshot_download# 创建保存模型目录
mkdir /content/models/model_ckpt# save_dir是模型保存到本地的目录
# repo_id是模型在huggingface中的id
save_dir/content/models/model_ckpt
repo_idbert-base-uncasedsnapshot_download(repo_idrepo_id, local_dirsave_dir, local_dir_use_symlinksFalse)
新建目录/content/models/model_ckpt批量下载全部模型文件到model_ckpt 参考
Download files from the Hub
批量快速下载huggingface的模型/数据文件的方法 - 知乎
上传、下载huggingface仓库文件模型、数据等_Reza.的博客-CSDN博客