调用huggingface类型的模型
时间: 2023-10-02 12:09:03 浏览: 164
要调用huggingface类型的模型,可以使用Huggingface-Transformers库。首先,需要安装并导入Huggingface-Transformers库。然后,使用AutoTokenizer.from_pretrained函数加载所需模型的tokenizer,使用AutoModel.from_pretrained函数加载对应的模型。其中,"MODEL_NAME"是指模型的名称,可以根据需求选择不同的模型。具体模型的名称列表可以在Huggingface的模型页面上找到。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [tensorflow2调用huggingface transformer预训练模型](https://blog.csdn.net/weixin_43880190/article/details/117817001)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [中文预训练ALBERT模型.zip](https://download.csdn.net/download/baidu_38876334/87975282)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [python调用huggingface的相关模型报错Could not download ‘pyannote/speaker-diarization‘ pipeline 解决...](https://blog.csdn.net/shanchuan2012/article/details/131767747)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文