Views
No views yet
spam_not_spam dataset.
It achieves the following results on the evaluation set: peft_config = LoraConfig(task_type=TaskType.SEQ_CLS, inference_mode=False, r=8, lora_alpha=32, lora_dropout=0.1)def compute_metrics(eval_pred):
predictions, labels = eval_pred
predictions = np.argmax(predictions, axis=1)
return {"accuracy": (predictions == labels).mean()}
trainer = Trainer(
model=lora_model,
args=TrainingArguments(
output_dir="./data/spam_not_spam",
# Set the learning rate
learning_rate = 2e-5,
# Set the per device train batch size and eval batch size
per_device_train_batch_size=16,
per_device_eval_batch_size=64,
# Evaluate and save the model after each epoch
evaluation_strategy = "epoch",
save_strategy = "epoch",
num_train_epochs=5,
weight_decay=0.01,
load_best_model_at_end=True,
),
train_dataset= tokenized_dataset_train,
eval_dataset= tokenized_dataset_test,
tokenizer=tokenizer,
data_collator=DataCollatorWithPadding(tokenizer=tokenizer),
compute_metrics=compute_metrics,
)| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|---|---|---|---|---|
| No log | 1.0 | 279 | 0.0414 | 0.9839 |
| 0.1982 | 2.0 | 558 | 0.0433 | 0.9865 |
| 0.1982 | 3.0 | 837 | 0.0465 | 0.9892 |
| 0.0415 | 4.0 | 1116 | 0.0426 | 0.9874 |
| 0.0415 | 5.0 | 1395 | 0.0415 | 0.9883 |