THUDM / GLM

GLM (General Language Model)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

用"THUDM/glm-10b-chinese"做分类任务出错

18335100284 opened this issue · comments

用“THUDM/glm-10b”加载模型时,没有问题。但使用"THUDM/glm-10b-chinese"会报错:

tokenizer = AutoTokenizer.from_pretrained("THUDM/glm-10b-chinese", trust_remote_code=True)
model = AutoModelForMultipleChoice.from_pretrained("THUDM/glm-10b-chinese", trust_remote_code=True)
Traceback (most recent call last):
File "", line 1, in
File "/home/zhangbinjian.zbj/.local/lib/python3.7/site-packages/transformers/models/auto/auto_factory.py", line 475, in from_pretrained
f"Unrecognized configuration class {config.class} for this kind of AutoModel: {cls.name}.\n"
ValueError: Unrecognized configuration class <class 'transformers_modules.THUDM.glm-10b-chinese.01717dd11fb4d3a80c465eee9eb4789bc954046d.configuration_glm.GLMConfig'> for this kind of AutoModel: AutoModelForMultipleChoice.
Model type should be one of AlbertConfig, BertConfig, BigBirdConfig, CamembertConfig, CanineConfig, ConvBertConfig, Data2VecTextConfig, DebertaV2Config, DistilBertConfig, ElectraConfig, ErnieConfig, ErnieMConfig, FlaubertConfig, FNetConfig, FunnelConfig, IBertConfig, LongformerConfig, LukeConfig, MegaConfig, MegatronBertConfig, MobileBertConfig, MPNetConfig, NezhaConfig, NystromformerConfig, QDQBertConfig, RemBertConfig, RobertaConfig, RobertaPreLayerNormConfig, RoCBertConfig, RoFormerConfig, SqueezeBertConfig, XLMConfig, XLMRobertaConfig, XLMRobertaXLConfig, XLNetConfig, XmodConfig, YosoConfig.

commented

@18335100284 请问怎么解决的?我用AutoTokenizer载入glm-2b和glm-10b-chinese都正常,但是载入glm-10b的模型时遇到了和您相似的错误?只不过是出现在AutoTokenizer上

tokenizer = AutoTokenizer.from_pretrained("THUDM/glm-10b", trust_remote_code=True)

ValueError: Unrecognized configuration class <class 'transformers_modules.THUDM.glm-10b.696788d4f82ac96b90823555f547d1e754839ff4.configuration_glm.GLMConfig'> to build an AutoTokenizer.

commented

@18335100284 请问怎么解决的?我用AutoTokenizer载入glm-2b和glm-10b-chinese都正常,但是载入glm-10b的模型时遇到了和您相似的错误?只不过是出现在AutoTokenizer上

问下这个问题是怎么解决的