微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何摆脱GPT-2警告消息?

如何解决如何摆脱GPT-2警告消息?

每次我运行GPT-2时,都会收到此消息。有什么办法可以解决这个问题吗?

Some weights of GPT2LMHeadModel were not initialized from the model checkpoint at gpt2 and are newly initialized: ['h.0.attn.masked_bias','h.1.attn.masked_bias','h.2.attn.masked_bias','h.3.attn.masked_bias','h.4.attn.masked_bias','h.5.attn.masked_bias','h.6.attn.masked_bias','h.7.attn.masked_bias','h.8.attn.masked_bias','h.9.attn.masked_bias','h.10.attn.masked_bias','h.11.attn.masked_bias','lm_head.weight']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.

解决方法

是的,您需要更改loglevel ,然后再从转换器库中导入任何内容

import logging
logging.basicConfig(level='ERROR')

from transformers import GPT2LMHeadModel

model = GPT2LMHeadModel.from_pretrained('gpt2')

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。