Update train.py
Browse files
train.py
CHANGED
@@ -420,7 +420,7 @@ def finetune(
|
|
420 |
# Compute F1-score for classification tasks
|
421 |
f1 = None
|
422 |
if task_type == "classification":
|
423 |
-
f1 = f1_score(all_targets, all_preds, average="
|
424 |
print(f"Epoch {epoch + 1}, Validation F1-Score: {f1:.4f}")
|
425 |
f1_scores.append(f1)
|
426 |
|
|
|
420 |
# Compute F1-score for classification tasks
|
421 |
f1 = None
|
422 |
if task_type == "classification":
|
423 |
+
f1 = f1_score(all_targets, all_preds, average="weighted")
|
424 |
print(f"Epoch {epoch + 1}, Validation F1-Score: {f1:.4f}")
|
425 |
f1_scores.append(f1)
|
426 |
|