Skip null PaperBench token usage during aggregation - #147
Open
sylvesterkaczmarek wants to merge 2 commits into
Open
Skip null PaperBench token usage during aggregation#147sylvesterkaczmarek wants to merge 2 commits into
sylvesterkaczmarek wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Keep successful SimpleJudge runs from failing during post-grade token aggregation when a leaf has no OpenAI token-usage metadata.
SimpleJudge.grade_leaf()includes atoken_usagekey injudge_metadata, but generic/non-OpenAI completers can leave its value asNone. The aggregation helper currently checks only whether the key exists and then passes the value toTokenUsage.from_dict(), which calls.items()and crashes onNone.Fixes #146.
Fix
Only deserialize leaf token usage when the metadata value is a dictionary. Null, missing, or otherwise unavailable usage contributes no token counts for that leaf.
Regression coverage
Adds tests verifying that:
{"token_usage": None}is skipped without error;TokenUsage serialization, OpenAI usage field mapping, and valid usage summation are unchanged.