# Model\_max\_length error in some models

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmodel-max-length-error-in-some-models%2F79695%3E%5C
**Category:** 🤗Transformers\
**Created:** [April 1, 2024, 4:32pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmodel-max-length-error-in-some-models%2F79695 "2024-04-01T16:32:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yananchen](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/yananchen/32/37864_2.png) [@yananchen](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fyananchen)%5C
**Post date:** [April 1, 2024, 4:32pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmodel-max-length-error-in-some-models%2F79695%2F1 "2024-04-01T16:32:20Z")

</div>

hi there,  
I find that for some models, in

> tokenizer = AutoTokenizer.from\_pretrained(model\_name)

such as mistralai/Mistral-7B-Instruct-v0.2, llama-2 series, the model\_max\_length=1000000000000000019884624838656. which is not correct.

for some models, such as lmsys/vicuna-7b-v1.5-16k, the model\_max\_length=16384, which is correct.

May I know the reason ?
