ValueError: Tokenizer class CodeGenTokenizer does not exist or is not currently imported.
#1
by
wepin
- opened
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Salesforce/codegen-2B-mono")
model = AutoModelForCausalLM.from_pretrained("Salesforce/codegen-2B-mono")
text = "def hello_world():"
input_ids = tokenizer(text, return_tensors="pt").input_ids
generated_ids = model.generate(input_ids, max_length=128)
print(tokenizer.decode(generated_ids[0], skip_special_tokens=True))
ValueError: Tokenizer class CodeGenTokenizer does not exist or is not currently imported.
rooa
changed discussion status to
closed