# Model\_max\_length error in some models

**URL:** <https://discuss.huggingface.co/t/model-max-length-error-in-some-models/79695>\
**Category:** 🤗Transformers\
**Created:** [April 1, 2024, 4:32pm UTC](https://discuss.huggingface.co/t/model-max-length-error-in-some-models/79695 "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](https://discuss.huggingface.co/u/yananchen)\
**Post date:** [April 1, 2024, 4:32pm UTC](https://discuss.huggingface.co/t/model-max-length-error-in-some-models/79695/1 "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 ?
