Transformers
English
Inference Endpoints

getting this error

#1
by hemangjoshi37a - opened

code :

from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("red1xe/falcon-7b-codeGPT-3K", trust_remote_code=True)
model = AutoModel.from_pretrained("red1xe/falcon-7b-codeGPT-3K", trust_remote_code=True, device='cpu')
model = model.eval()

error :
```

ValueError Traceback (most recent call last)
Cell In[4], line 2
1 from transformers import AutoTokenizer, AutoModel
----> 2 tokenizer = AutoTokenizer.from_pretrained("red1xe/falcon-7b-codeGPT-3K", trust_remote_code=True)
3 model = AutoModel.from_pretrained("red1xe/falcon-7b-codeGPT-3K", trust_remote_code=True, device='cpu')
4 model = model.eval()

File ~/.local/lib/python3.11/site-packages/transformers/models/auto/tokenization_auto.py:658, in AutoTokenizer.from_pretrained(cls, pretrained_model_name_or_path, *inputs, **kwargs)
656 if config_tokenizer_class is None:
657 if not isinstance(config, PretrainedConfig):
--> 658 config = AutoConfig.from_pretrained(
659 pretrained_model_name_or_path, trust_remote_code=trust_remote_code, **kwargs
660 )
661 config_tokenizer_class = config.tokenizer_class
662 if hasattr(config, "auto_map") and "AutoTokenizer" in config.auto_map:

File ~/.local/lib/python3.11/site-packages/transformers/models/auto/configuration_auto.py:966, in AutoConfig.from_pretrained(cls, pretrained_model_name_or_path, **kwargs)
963 if pattern in str(pretrained_model_name_or_path):
964 return CONFIG_MAPPING[pattern].from_dict(config_dict, **unused_kwargs)
--> 966 raise ValueError(
967 f"Unrecognized model in {pretrained_model_name_or_path}. "
968 f"Should have a model_type key in its {CONFIG_NAME}, or contain one of the following strings "
969 f"in its name: {', '.join(CONFIG_MAPPING.keys())}"
970 )

ValueError: Unrecognized model in red1xe/falcon-7b-codeGPT-3K. Should have a model_type key in its config.json, or contain one of the following strings in its name: albert, align, altclip, audio-spectrogram-transformer, autoformer, bart, beit, bert, bert-generation, big_bird, bigbird_pegasus, biogpt, bit, blenderbot, blenderbot-small, blip, blip-2, bloom, bridgetower, camembert, canine, chinese_clip, clap, clip, clipseg, codegen, conditional_detr, convbert, convnext, convnextv2, cpmant, ctrl, cvt, data2vec-audio, data2vec-text, data2vec-vision, deberta, deberta-v2, decision_transformer, deformable_detr, deit, deta, detr, dinat, distilbert, donut-swin, dpr, dpt, efficientformer, efficientnet, electra, encoder-decoder, ernie, ernie_m, esm, flaubert, flava, fnet, focalnet, fsmt, funnel, git, glpn, gpt-sw3, gpt2, gpt_bigcode, gpt_neo, gpt_neox, gpt_neox_japanese, gptj, gptsan-japanese, graphormer, groupvit, hubert, ibert, imagegpt, informer, jukebox, layoutlm, layoutlmv2, layoutlmv3, led, levit, lilt, llama, longformer, longt5, luke, lxmert, m2m_100, marian, markuplm, mask2former, maskformer, maskformer-swin, mbart, mctct, mega, megatron-bert, mgp-str, mobilebert, mobilenet_v1, mobilenet_v2, mobilevit, mobilevitv2, mpnet, mt5, mvp, nat, nezha, nllb-moe, nystromformer, oneformer, open-llama, openai-gpt, opt, owlvit, pegasus, pegasus_x, perceiver, pix2struct, plbart, poolformer, prophetnet, qdqbert, rag, realm, reformer, regnet, rembert, resnet, retribert, roberta, roberta-prelayernorm, roc_bert, roformer, rwkv, sam, segformer, sew, sew-d, speech-encoder-decoder, speech_to_text, speech_to_text_2, speecht5, splinter, squeezebert, swiftformer, swin, swin2sr, swinv2, switch_transformers, t5, table-transformer, tapas, time_series_transformer, timesformer, timm_backbone, trajectory_transformer, transfo-xl, trocr, tvlt, unispeech, unispeech-sat, upernet, van, videomae, vilt, vision-encoder-decoder, vision-text-dual-encoder, visual_bert, vit, vit_hybrid, vit_mae, vit_msn, wav2vec2, wav2vec2-conformer, wavlm, whisper, xclip, xglm, xlm, xlm-prophetnet, xlm-roberta, xlm-roberta-xl, xlnet, xmod, yolos, yoso

https://hjlabs.in

I'm new in this field. I'm trying to figure out fix this problem. This model has been trained from "vilsonrodrigues/falcon-7b-instruct-sharded" with code_instructions dataset selecting 3K row. So the "model_type = falcon" but transformers library doesn't support falcon models. Thats why my trying to train Llama-2 with same dataset. You can follow me to keep up to date with the developments.

Sign up or log in to comment