Hi, I am having problems trying to load a model after training it.
First, I trained and saved the model using
trainer = transformers.Trainer(
model=model,
train_dataset=data["train"],
args=transformers.TrainingArguments(
per_device_train_batch_size=1,
gradient_accumulation_steps=8,
warmup_steps=2,
max_steps=20,
learning_rate=2e-4,
fp16=True,
logging_steps=1,
output_dir="outputs",
optim="paged_adamw_8bit",
),
data_collator=transformers.DataCollatorForLanguageModeling(tokenizer, mlm=False),
)
trainer.train()
trainer.save_model("outputs/finetuned")
This produced a directory containing the files
pytorch_model.bin
training_args.bin
Now when I try to load the model using
model = AutoModelForCausalLM.from_pretrained(
"outputs/finetuned",
quantization_config=quant_config,
device_map={"": 0},
local_files_only=True,
)
I am getting the error
OSError: outputs/finetuned does not appear to have a file named config.json. Checkout 'https://huggingface.co/outputs/finetuned/None' for available files.
How do I get Trainer
to save the model with this config.json
file?
Thanks!