# Llama2-70b SafetensorError: Error while deserializing header: HeaderTooLarge

**URL:** <https://discuss.huggingface.co/t/llama2-70b-safetensorerror-error-while-deserializing-header-headertoolarge/65157>\
**Category:** 🤗Transformers\
**Created:** [December 9, 2023, 11:38am UTC](https://discuss.huggingface.co/t/llama2-70b-safetensorerror-error-while-deserializing-header-headertoolarge/65157 "2023-12-09T11:38:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kyrie7AIwarts](https://avatars.discourse-cdn.com/v4/letter/k/a87d85/32.png) [@Kyrie7AIwarts](https://discuss.huggingface.co/u/Kyrie7AIwarts)\
**Post date:** [December 9, 2023, 11:38am UTC](https://discuss.huggingface.co/t/llama2-70b-safetensorerror-error-while-deserializing-header-headertoolarge/65157/1 "2023-12-09T11:38:09Z")

</div>

I tried to load llama-2-70b-chat-hf with the following code:  
import torch  
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig  
base\_model = ‘/llm/llama2-2-70b-chat-hf’  
model = AutoModelForCausalLM( base\_model, load\_in\_8bit=True, device\_map={“”,0},use\_safetensors=True)

and the Error is shown below:  
in load\_state\_dict (checkpoint\_file)  
462 “”"  
463 Reads a Pytorch checkpoint file, returning properly formatted errors if they arise.  
464 “”"  
465 if checkpoint\_file.endswith(“.safetensors”) and is\_safetensors\_available():  
–\>466 with safe\_open(checkpoint\_file,framework=“pt”) as f:  
467 metadata=f.metadate()  
SafetensorError: Error while deserializing header: HeaderTooLarge

I tried to re-download the safetensors file but it cannot be solved.
