From 91ee51a91a91fcdea8ac4c3d91f5d795f96c564c Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Tue, 26 Dec 2023 11:48:14 -0500 Subject: [PATCH] Update eval_gauntlet_callback.py with math.log2 Saw an automated ruff flag this, seems like a strict improvement and is marginally faster. --- llmfoundry/callbacks/eval_gauntlet_callback.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llmfoundry/callbacks/eval_gauntlet_callback.py b/llmfoundry/callbacks/eval_gauntlet_callback.py index 4c2bcfe297..7544d66040 100644 --- a/llmfoundry/callbacks/eval_gauntlet_callback.py +++ b/llmfoundry/callbacks/eval_gauntlet_callback.py @@ -117,8 +117,7 @@ def __init__(self, elif self.weighting == Weighting.SAMPLE_SZ: weight = cumulative_samples elif self.weighting == Weighting.LOG_SAMPLE_SZ: - weight = max(math.log(cumulative_samples, 2), 1) - + weight = max(math.log2(cumulative_samples), 1) assert weight is not None benchmark['weighting'] = weight