this is origin model,it occupies 678MB. However, finetuned model occupies 1.33GB
TrainingArguments Setting
Prepare the trainer and start training
training_args = TrainingArguments(
output_dir=output_dir,
num_train_epochs=2,
per_device_train_batch_size=1,
per_device_eval_batch_size=2,
eval_steps=10,
save_steps=10,
warmup_steps=100,
learning_rate=1e-5,
fp16=True,
do_train=True,
do_eval=True,
save_strategy='steps',
save_total_limit=3,
evaluation_strategy='steps',
load_best_model_at_end=True,
logging_steps=50,
logging_dir='./logs')
trainer = MyTrainer(
model,
training_args,
train_dataset=train_dataloader,
eval_dataset=dev_dataloader,
data_collator=collate_fn,
tokenizer=tokenizer
) # 在定义了tokenizer之后,这里的data_collator
Thanks for answering