# Llama 2 deployed with different content lengths?

**URL:** <https://discuss.huggingface.co/t/llama-2-deployed-with-different-content-lengths/52859>\
**Category:** Inference Endpoints on the Hub\
**Created:** [August 30, 2023, 6:32pm UTC](https://discuss.huggingface.co/t/llama-2-deployed-with-different-content-lengths/52859 "2023-08-30T18:32:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tiagosilva](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/tiagosilva/32/19027_2.png) [@tiagosilva](https://discuss.huggingface.co/u/tiagosilva)\
**Post date:** [August 30, 2023, 6:32pm UTC](https://discuss.huggingface.co/t/llama-2-deployed-with-different-content-lengths/52859/1 "2023-08-30T18:32:30Z")

</div>

Hi there,

I deployed a aws-llama-2-7b-chat-hf model and tried to query it, but I get the following error:

{‘error’: ‘Input validation error: `inputs` tokens + `max_new_tokens` must be \<= 1512. Given: 3294 `inputs` tokens and 20 `max_new_tokens`’, ‘error\_type’: ‘validation’}

But the Content Length for all llama 2 models is supposed to be 4k. What gives? Can anyone shed some light?

---

<div class="post-metadata">

**Author:** ![philschmid](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/philschmid/32/38022_2.png) [@philschmid](https://discuss.huggingface.co/u/philschmid)\
**Post date:** [August 31, 2023, 6:15am UTC](https://discuss.huggingface.co/t/llama-2-deployed-with-different-content-lengths/52859/2 "2023-08-31T06:15:39Z")

</div>

You can confgure those values when creating a new endpoint in the advanced section. 1512 is the default
