fix(eval/uni_mmmu): add missing import colorsys for >9-category sliding-puzzle palette - #32
Open
Anai-Guo wants to merge 1 commit into
Open
Conversation
…ng-puzzle palette parse_sliding_puzzle_image._distinct_palette_k falls back to colorsys.hsv_to_rgb when num_categories > 9 (e.g. a 4x4 board with 16 tiles), but colorsys is never imported, so that branch raises NameError: name 'colorsys' is not defined. The default config uses num_categories=9 which takes the SET1_9 branch, so this stays latent until a larger board / higher category count is configured.
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.
Problem
In
eval/generation/uni_mmmu/eval_ummmu.py,parse_sliding_puzzle_imagebuilds a color palette via a local helper:The
k > 9branch callscolorsys.hsv_to_rgb(...), butcolorsysis never imported anywhere in the file. So whenevernum_categories > 9— the very case that branch exists to serve, e.g. a 4×4 sliding puzzle (16 tiles) — the parser raises:The default config (
num_categories: 9) takes theSET1_9branch, so the bug stays latent until a larger board / higher category count is configured, at which point the image-evaluation loop (parse_sliding_puzzle_imageis called on every GT and candidate image) crashes.Fix
Add the missing
import colorsysto the stdlib import block (one line, placed alphabetically).Verification
Extracting the helper verbatim:
🤖 Generated with Claude Code