참고 : https://github.com/huggingface/transformers/issues/27397
PEFT
랑 torch.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