Getting error in loading the tokenizer

#1
by smjain - opened

ValueError Traceback (most recent call last)
in ()
1 from transformers import AutoTokenizer, AutoModelForCausalLM
----> 2 tokenizer = AutoTokenizer.from_pretrained("Salesforce/codegen-350M-nl")
3 model = AutoModelForCausalLM.from_pretrained("Salesforce/codegen-350M-nl")
4
5 text = "def hello_world():"

/usr/local/lib/python3.7/dist-packages/transformers/models/auto/tokenization_auto.py in from_pretrained(cls, pretrained_model_name_or_path, *inputs, **kwargs)
575 if tokenizer_class is None:
576 tokenizer_class_candidate = config_tokenizer_class
--> 577 tokenizer_class = tokenizer_class_from_name(tokenizer_class_candidate)
578
579 if tokenizer_class is None:

ValueError: Tokenizer class CodeGenTokenizer does not exist or is not currently imported.

Salesforce org

Hi @smjain , this is due to CodeGen not being included in a release yet. Please follow this and update your transformers installation with the dev version from the main branch: pip install git+https://github.com/huggingface/transformers.git.

rooa changed discussion status to closed

Sign up or log in to comment