I am trying to save a model during finetuning but I get this error ?
trainer, outdir = prepare_fine_tuning(PRE_TRAINED_MODEL_NAME, train_dataset, val_dataset, tokenizer, sigle, train_name, elt_train.name)

trainer.train()
trainer.evaluate()						
						
#trainer.save_model(modeldir)
trainer.save_pretrained(modeldir)
tokenizer.save_pretrained(modeldir)
					

 trainer.save_pretrained(modeldir)
AttributeError: 'Trainer' object has no attribute 'save_pretrained'


Transformers version 4.8.0