建立Hugging Face模型调用环境
简介:
本文介绍了如何在环境中导入transformers库,并从Hugging Face网站下载模型。如果使用镜像网站,需获取access token。部分模型需申请仓库权限,建议使用国外信息填写。有GPU的用户需先配置CUDA和pytorch-gpu。
1. 需要在环境中导入transformers库。

2. 需要到Hugging Face网站下载模型。(TODO为下载保存的本地地址)

3. 网站下载模型时采用镜像网站的话,需要到Hugging Face原网站上获取access token。跳转链接见hf- mirror首页最下方。

4. 个别模型需要申请仓库权限。节点地址、姓名、国家、联系方式都需要使用国外的才可以通过。建议设置如下。

