How to load model after running Trainer.save_model?
Hi, I am having problems trying to load a model after training it.First, I trained and saved the model usingtrainer = 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 filespytorch_model.bintraining_args.binNow when I try to load the model usingmodel = AutoModelForCausalLM.from_pretrained(
    "outputs/finetuned",
    quantization_config=quant_config,
    device_map={"": 0},
    local_files_only=True,
)I am getting the errorOSError: 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 getTrainerto save the model with thisconfig.jsonfile?Thanks!
2023-07-27T05:50:38Z
Hey facing the same issue . Does it got resolved ?
2023-11-28T11:56:09Z
facing the same issue as well
2023-11-28T14:41:15Z
What is the model are you using?Try usingmodel.save_pretrained(path/to/folder), does that work?