Skip to content

fix: correct model_type comparison bug, f-string typo, and bare except clauses#410

Open
Ricardo-M-L wants to merge 1 commit intobigscience-workshop:mainfrom
Ricardo-M-L:fix/logic-and-format-bugs
Open

fix: correct model_type comparison bug, f-string typo, and bare except clauses#410
Ricardo-M-L wants to merge 1 commit intobigscience-workshop:mainfrom
Ricardo-M-L:fix/logic-and-format-bugs

Conversation

@Ricardo-M-L
Copy link
Copy Markdown

Summary

  • Logic bug in tools/merge_mp_partitions.py: model_type == ['MNLI', 'QQP'] compares a string to a list, which always evaluates to False — MNLI and QQP models can never be loaded. Changed to model_type in ['MNLI', 'QQP'].
  • F-string typo in megatron/testing_utils.py: f"...output: f{out_pr}" prints a literal f before the variable. Removed the stray f.
  • Bare except: in 3 files: Replaced with except Exception: to avoid catching SystemExit and KeyboardInterrupt.

Test plan

  • merge_mp_partitions.py: verified the elif branch now matches string values correctly
  • testing_utils.py: assert message now formats the output variable properly
  • All bare except replacements preserve existing error handling behavior

🤖 Generated with Claude Code

- fix model_type comparison: `== ['MNLI', 'QQP']` always evaluates to
  False because it compares a string to a list; use `in` instead
- fix f-string format: `f{out_pr}` prints literal 'f' prefix instead
  of the variable value; remove the stray 'f'
- replace bare `except:` with `except Exception:` in 3 files to avoid
  catching SystemExit and KeyboardInterrupt

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant