Sorry, I realized my mistake. It should have been like this: tokenizer = AutoTokenizer.from_pretrained… model = AutoModelWithLMHead.from_pretraine…