You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OSError: AutoModel is designed to be instantiated using the AutoModel.from_pretrained(pretrained_model_name_or_path) or AutoModel.from_config(config) methods.
The text was updated successfully, but these errors were encountered:
----- 原始邮件 -----
***@***.***>
***@***.***>等3人
主题:Re:_[yongzhuo/Pytorch-NLU]_求回复:用bert-tiny做多标签分类,训练没有问题,保存了tc.config和tc.model,推理的时候在加载模型的地方报错_(Issue_#12)
日期:2024年03月06日 09:04:20
同huggingface/transformers#11953,transformers的__init__()初始化传参不一样导致,还是不要改成Auto的
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
----- 原始邮件 -----
***@***.***>
***@***.***>等3人
主题:Re:_[yongzhuo/Pytorch-NLU]_求回复:用bert-tiny做多标签分类,训练没有问题,保存了tc.config和tc.model,推理的时候在加载模型的地方报错_(Issue_#12)
日期:2024年03月06日 09:12:28
可以的,这是同架构的
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
self.pretrain_model = pretrained_model(self.pretrained_config) # 推理时候只需要加载超参数, 不需要预训练模型的权重
预训练模型是bert-tiny,加载用的AutotModel,不是BertModel
在tcGraph.py的这行报错,报错如下
OSError: AutoModel is designed to be instantiated using the
AutoModel.from_pretrained(pretrained_model_name_or_path)
orAutoModel.from_config(config)
methods.The text was updated successfully, but these errors were encountered: