Different lm_head size and vocab_size
Hi i was playing around withfacebook/opt-1.3band i noticed that it sometimes generates tokens with values bigger than the tokenizervocab_size.Indeed running this codefrom transformers import AutoTokenizer, AutoModelForCausalLM

model_name = "facebook/opt-1.3b"
tokenizer_name = "facebook/opt-1.3b"

model = AutoModelForCausalLM.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(tokenizer_name)

print(model.lm_head)
print(tokenizer.vocab_size)it seems that the output size of thelm_headlayer is bigger than thevocab_sizeLinear(in_features=2048, out_features=50272, bias=False)
50265Am i usingopt-1.3bwrong? is this supposed to happen for some reason? shall i just ignore the logits after the 50265-th?Edit:this happens when usinggeneratewith this argumentsoutputs = self.model.generate(
    tokens.unsqueeze(0),
    return_dict_in_generate=True,
    output_scores=True,
    max_new_tokens=1,
    max_length=None,
)