Skip to content

fix: ignore empty trailing pieces in sentence count#1780

Open
Chessing234 wants to merge 2 commits into
allenai:mainfrom
Chessing234:fix/sentence-constraint-empty-trailing
Open

fix: ignore empty trailing pieces in sentence count#1780
Chessing234 wants to merge 2 commits into
allenai:mainfrom
Chessing234:fix/sentence-constraint-empty-trailing

Conversation

@Chessing234

@Chessing234 Chessing234 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Trailing terminators left an empty split, inflating the sentence count.
  • Drop empty pieces after the split.

Test plan

  • TestVerifySentenceConstraint

GPU_TESTS=bypass
CHANGELOG=

Chessing234 and others added 2 commits July 18, 2026 20:03
A terminator at the end of the text produced an extra empty split.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

@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 updates the verify_sentence_constraint function in open_instruct/if_functions.py to filter out empty or whitespace-only strings resulting from splitting sentences with trailing terminators. Additionally, a new test suite TestVerifySentenceConstraint has been added to open_instruct/test_if_functions.py to validate this behavior, and the CHANGELOG.md has been updated accordingly. There are no review comments, so there is 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.

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