💬 LANGUAGES/Python

[오류해결] safetensors_rust.SafetensorError: Error while deserializing header: InvalidHeaderDeserialization

삶감 2023. 11. 29. 19:57

참고 : https://github.com/huggingface/transformers/issues/27397

 

SafetensorError: Error while deserializing header: InvalidHeaderDeserialization when open .safetensor model · Issue #27397 · h

System Info Hi guys, i just fine tune alpaca (LLaMA 7B base model) with custom dataset and using trainer API. After completing the training process, I received the following error: SafetensorError ...

github.com

 

 

 

PEFTtorch.complie 이랑 같이 쓰면 오류가 남.
torch.complie 을 주석처리 해주고 train을 돌리면 괜찮다고 한다.

 

 

 

model.state_dict = (
    lambda self, *_, **__: get_peft_model_state_dict(
        self, old_state_dict()
    )
).__get__(model, type(model))

# if torch.__version__ >= "2" and sys.platform != "win32":
#     model = torch.compile(model)
## safeTensor is not working with compile
## https://github.com/huggingface/transformers/issues/27397

trainer.train(resume_from_checkpoint=resume_from_checkpoint)

model.save_pretrained(output_dir)
torch.save(slama_model.embeddings, os.path.join(output_dir, "embeddings.pth"))

 

728x90
728x90