CodeT5 icon indicating copy to clipboard operation
CodeT5 copied to clipboard

Unrecognized configuration class from AutoModelForCausalLM.from_pretrained

Open aseok opened this issue 2 years ago • 1 comments

Tried the ggml conversion instructions for codet5p-220m-py, codet5p-770m-py and instructcodet5p-16b facing following error:

File ".../.local/lib/python3.8/site-packages/transformers/models/auto/auto_factory.py", line 470, in from_pretrained raise ValueError( (for 220m & 770m models) ValueError: Unrecognized configuration class <class 'transformers.models.t5.configuration_t5.T5Config'> for this kind of AutoModel: AutoModelForCausalLM.

(for 16b model) ValueError: Unrecognized configuration class <class 'transformers_modules.Salesforce.instructcodet5p-16b.70bb08afa3d6f081b347e67752ca8e031a35ac4a.configuration_codet5p.CodeT5pConfig'> for this kind of AutoModel: AutoModelForCausalLM.

Model type should be one of BartConfig, BertConfig, BertGenerationConfig, BigBirdConfig, BigBirdPegasusConfig, BioGptConfig, BlenderbotConfig, BlenderbotSmallConfig, BloomConfig, CamembertConfig, CodeGenConfig, CpmAntConfig, CTRLConfig, Data2VecTextConfig, ElectraConfig, ErnieConfig, GitConfig, GPT2Config, GPT2Config, GPTBigCodeConfig, GPTNeoConfig, GPTNeoXConfig, GPTNeoXJapaneseConfig, GPTJConfig, LlamaConfig, MarianConfig, MBartConfig, MegaConfig, MegatronBertConfig, MvpConfig, OpenLlamaConfig, OpenAIGPTConfig, OPTConfig, PegasusConfig, PLBartConfig, ProphetNetConfig, QDQBertConfig, ReformerConfig, RemBertConfig, RobertaConfig, RobertaPreLayerNormConfig, RoCBertConfig, RoFormerConfig, RwkvConfig, Speech2Text2Config, TransfoXLConfig, TrOCRConfig, XGLMConfig, XLMConfig, XLMProphetNetConfig, XLMRobertaConfig, XLMRobertaXLConfig, XLNetConfig, XmodConfig.

aseok avatar May 21 '23 07:05 aseok

Hi there, as our CodeT5+ is a family of encoder-decoder based LLMs, the correct auto class to use would be AutoModelForSeq2SeqLM instead of AutoModelForCausalLM .

yuewang-cuhk avatar May 22 '23 01:05 yuewang-cuhk