描述错误
我使用的模型是UniLM:
我使用以下代码加载模型。
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("microsoft/unilm-base-cased")
然后得到了这样的traceback:
ValueError: 在microsoft/unilm-base-cased中无法识别的模型。它的config.json中应该有一个 model_type
键,或者其名称中包含以下字符串之一:albert, bart, beit, bert, bert-generation, big_bird, bigbird_pegasus, blenderbot, blenderbot-small, bloom, camembert, canine, clip, codegen, conditional_detr, convbert, convnext, ctrl, cvt, data2vec-audio, data2vec-text, data2vec-vision, deberta, deberta-v2, decision_transformer, deformable_detr, deit, detr, distilbert, donut-swin, dpr, dpt, electra, encoder-decoder, ernie, esm, flaubert, flava, fnet, fsmt, funnel, glpn, gpt2, gpt_neo, gpt_neox, gpt_neox_japanese, gptj, groupvit, hubert, ibert, imagegpt, layoutlm, layoutlmv2, layoutlmv3, led, levit, lilt, longformer, longt5, luke, lxmert, m2m_100, marian, markuplm, maskformer, mbart, mctct, megatron-bert, mobilebert, mobilevit, mpnet, mt5, mvp, nezha, nystromformer, openai-gpt, opt, owlvit, pegasus, pegasus_x, perceiver, plbart, poolformer, prophetnet, qdqbert, rag, realm, reformer, regnet, rembert, resnet, retribert, roberta, roformer, segformer, sew, sew-d, speech-encoder-decoder, speech_to_text, speech_to_text_2, splinter, squeezebert, swin, swinv2, t5, table-transformer, tapas, time_series_transformer, trajectory_transformer
1条答案
按热度按时间gzjq41n41#
你找到解决这个问题的方法了吗?