ggml icon indicating copy to clipboard operation
ggml copied to clipboard

codet5 Unrecognized configuration class from AutoModelForCausalLM.from_pretrained

Open aseok opened this issue 1 year 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

From https://huggingface.co/Salesforce/codet5p-220m-py, codet5p-220m-py and codet5p-770m-py should be called with 'AutoModelForCausalLM' rather than 'AutoModelForCausalLM'

from transformers import AutoModelForSeq2SeqLM

model = AutoModelForSeq2SeqLM.from_pretrained("Salesforce/codet5p-220m-py")

For instructcodet5p-16b, it should be called as

from transformers import AutoModel

model = AutoModel.from_pretrained("Salesforce/instructcodet5p-16b")

jaeminSon avatar May 22 '23 11:05 jaeminSon