From 70b7691bf3eca5f856aa9e5b4e27842481edb4ef Mon Sep 17 00:00:00 2001 From: till-m <36440677+till-m@users.noreply.github.com> Date: Mon, 20 Oct 2025 19:22:59 +0200 Subject: [PATCH 1/2] Fix denominator calculation for validation length --- the_well/benchmark/trainer/training.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/the_well/benchmark/trainer/training.py b/the_well/benchmark/trainer/training.py index 772dfa41..69ef49a9 100644 --- a/the_well/benchmark/trainer/training.py +++ b/the_well/benchmark/trainer/training.py @@ -314,7 +314,7 @@ def validation_loop( loss_dict = {} time_logs = {} count = 0 - denom = len(dataloader) if full else self.short_validation_length + denom = len(dataloader) if full else min(self.short_validation_length, len(dataloader)) with torch.autocast( self.device.type, enabled=self.enable_amp, dtype=self.amp_type ): From be8fc1f8152f7b7c534bf1ee39ef87aa7a4aef22 Mon Sep 17 00:00:00 2001 From: till-m <36440677+till-m@users.noreply.github.com> Date: Tue, 21 Oct 2025 16:57:15 +0200 Subject: [PATCH 2/2] fix: linting --- the_well/benchmark/trainer/training.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/the_well/benchmark/trainer/training.py b/the_well/benchmark/trainer/training.py index 69ef49a9..ed9b268d 100644 --- a/the_well/benchmark/trainer/training.py +++ b/the_well/benchmark/trainer/training.py @@ -314,7 +314,11 @@ def validation_loop( loss_dict = {} time_logs = {} count = 0 - denom = len(dataloader) if full else min(self.short_validation_length, len(dataloader)) + denom = ( + len(dataloader) + if full + else min(self.short_validation_length, len(dataloader)) + ) with torch.autocast( self.device.type, enabled=self.enable_amp, dtype=self.amp_type ):