Skip to content

Robust list config parsing and improved SFT docs#4101

Open
shralex wants to merge 1 commit into
mainfrom
shralex_ux5
Open

Robust list config parsing and improved SFT docs#4101
shralex wants to merge 1 commit into
mainfrom
shralex_ux5

Conversation

@shralex
Copy link
Copy Markdown
Collaborator

@shralex shralex commented Jun 6, 2026

  • Added automatic string-to-list and tuple-to-list coercion in pyconfig.py for list[str] configuration fields (train_data_columns, eval_data_columns, trainable_parameters_mask, adamw_mask) to prevent unhelpful Pydantic validation errors.
  • Added comprehensive unit tests in pyconfig_test.py covering 6 coercion scenarios and end-to-end integration.
  • Added unit tests in instruction_data_processing_test.py validating that unsupported SFT columns throw helpful, descriptive assertion errors.
  • Expanded docs/tutorials/posttraining/sft.md to document SFT schemas, custom chat templates, ShareGPT custom formatters, and linked a runnable example.

FIXES: b/520789228

Tests

Added unit tests to cover the new code.

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

@shralex shralex changed the title feat(sft): robust list config parsing and improved SFT docs Robust list config parsing and improved SFT docs Jun 6, 2026
- Added automatic string-to-list and tuple-to-list coercion in pyconfig.py
  for list[str] configuration fields (train_data_columns, eval_data_columns,
  trainable_parameters_mask, adamw_mask) to prevent unhelpful Pydantic validation errors.
- Added comprehensive unit tests in pyconfig_test.py covering 6 coercion
  scenarios and end-to-end integration.
- Added unit tests in instruction_data_processing_test.py validating that
  unsupported SFT columns throw helpful, descriptive assertion errors.
- Expanded docs/tutorials/posttraining/sft.md to document SFT schemas, custom
  chat templates, ShareGPT custom formatters, and linked a runnable example.
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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