Skip to content

Commit d57b3b5

Browse files
authored
Update eval to create scoring metric, disable mean resizing for modernbert. (#228)
1 parent c253e7f commit d57b3b5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/cnlpt/CnlpModelForClassification.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,9 @@ def __init__(
302302
# CANINE's hashable embeddings for unicode codepoints allows for
303303
# additional parameterization, which rn doesn't seem so relevant
304304
if not config.character_level:
305-
self.encoder.resize_token_embeddings(encoder_config.vocab_size)
305+
self.encoder.resize_token_embeddings(
306+
encoder_config.vocab_size, mean_resizing=False
307+
)
306308

307309
# This would seem to be redundant with the label list, which maps from tasks to labels,
308310
# but this version is ordered. This will allow the user to specify an order for any methods

src/cnlpt/train_system.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ def compute_metrics_fn(p: EvalPrediction):
714714
task_label_to_boundaries,
715715
)
716716
)
717-
717+
metrics["one_score"] = one_score
718718
return metrics
719719

720720
return compute_metrics_fn

0 commit comments

Comments
 (0)