from transformers import AutoTokenizer, LlamaForCausalLM, LlamaConfig, TrainingArguments ,DataCollatorForLanguageModeling import torch tokenizer = AutoTokenizer.from_pretrained("./") model = LlamaForCausalLM.from_pretrained("./") torch.save(model, "pytorch_model.bin")