From 5238f15e2d1bc08dc9669f8950f32dd6d2b889c1 Mon Sep 17 00:00:00 2001 From: Shuo Zhang Date: Mon, 4 Sep 2023 23:14:07 +0800 Subject: [PATCH] fix(eval): no need to check length of valid_dl when using streaming dataset (#274) * fix(eval): StreamingDataset does not have an __len__ method. * fix(eval): StreamingDataset has no len method --- internlm/utils/evaluation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internlm/utils/evaluation.py b/internlm/utils/evaluation.py index 872ef87..2b9a384 100644 --- a/internlm/utils/evaluation.py +++ b/internlm/utils/evaluation.py @@ -136,7 +136,7 @@ def evaluate_on_val_dls( dist.barrier() val_res = val_metric.get_metric() - if verbose and len(val_dl) != 0: + if verbose and (streaming or len(val_dl) != 0): val_loss = val_loss / (val_idx + 1 + 1e-6) infos = { "step": step_count,