Skip to content

fix: correct class name in SyntheticDataKit.chunk_data guard message - #6901

Merged
danielhanchen merged 2 commits into
unslothai:mainfrom
anxkhn:patch-6
Jul 6, 2026
Merged

danielhanchen merged 2 commits into
unslothai:mainfrom
anxkhn:patch-6

Conversation

@anxkhn

@anxkhn anxkhn commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What

SyntheticDataKit.chunk_data raises a guard error when it is called before the
kit is initialized (max_seq_length unset), telling the user which method to
call first. The class name in that message is misspelled:

# unsloth/dataprep/synthetic.py
raise RuntimeError("Please use SynthetidDataKit.from_pretrained(...) first!")
#                               ^^^^^^^^^ "Synthetid" (transposed), not "Synthetic"

The class is SyntheticDataKit (defined in the same file, exported in
__all__, constructed via the from_pretrained classmethod). A user who copies
the instruction verbatim hits a second, confusing error:

NameError: name 'SynthetidDataKit' is not defined

Fix

Correct the single misspelled token in the message
(Synthetid -> Synthetic) so the guidance is actionable. This is
user-facing error text only; there is no behavior change.

Test

Adds one regression test to tests/test_synthetic_chunk_data.py that builds a
kit without max_seq_length, calls chunk_data, and asserts the raised message
names SyntheticDataKit.from_pretrained and does not contain the old
misspelling.

Notes

  • Single focused change per CONTRIBUTING.
  • Lint: ruff check on both files passes.
  • No linked issue exists; found while reading dataprep.

chunk_data raised RuntimeError("Please use SynthetidDataKit.from_pretrained(...)
first!") when max_seq_length was unset. The class is SyntheticDataKit, so a user
copying the instruction verbatim hit NameError: name 'SynthetidDataKit' is not
defined. Fix the misspelling (Synthetid -> Synthetic) so the guidance is
actionable. User-facing text only; no behavior change.

Add a regression test asserting the message names SyntheticDataKit.from_pretrained
and does not contain the old misspelling.
@anxkhn
anxkhn requested a review from danielhanchen as a code owner July 6, 2026 12:04

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes a typo in the RuntimeError message raised by chunk_data when max_seq_length is uninitialized, correcting 'SynthetidDataKit' to 'SyntheticDataKit'. It also adds a corresponding unit test to verify that the error message correctly names the class. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Jul 6, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 300682c8f5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen danielhanchen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed the guard message misspelled the class name and that the added regression test fails without the fix and passes with it. Thanks.

@danielhanchen
danielhanchen merged commit cc99aab into unslothai:main Jul 6, 2026
1 check passed
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.

2 participants