Repository navigation
kev-finetune: reject a fractional score index instead of truncating it - #241
Merged
Merged
Conversation
int(float) truncated 1.9 to 1, and Infinity raised OverflowError past the ValueError handler, so one bad cell aborted the file. Decimal still rejects those, and the range check is its own line so the skip reason is readable. Co-authored-by: aakash-kharb <akgdsc7@gmail.com>
jaredpalmer
marked this pull request as ready for review
October 15, 2026 22:40
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.
convert_data.pyturns a score column into a level index withint(float(text)).1.9becomes 1, so a row that is not on the scale is trained as the level below it.InfinityraisesOverflowError, and the handler only catchesValueError, so that one cell aborts the file.This continues #239. A score label is parsed with
Decimal, which keeps1.9and0.99999999999999999distinct from 1, wherefloatrounds them. A non-finite value or a fraction is skipped and counted by reason.1,1.0,2e0and-0.0stay integers, and level text still matches when the token is not a number. The in-range check runs on theDecimalbeforeint().int(Decimal("1e9999999"))would build a multi-million-digit integer. The test includes that token, and it is skipped as out of range.The assumption is that a score index is a whole number of levels, and
--score-offsetonly shifts that integer. A level whose text is numeric is unchanged, because a numeric token is still read as an index first.generate_data.pyalready asks for an integer index, so it is left alone. Nothing in training or serving changes, so there is no parity run againstmain.Test plan
uv run --extra serve python -m pytest tests/test_skill_scripts.py -qon this branch: 35 passed1.9,NaN,Infinity,1e9999999(skipped without building the integer),1.0,2e0,-0.0, level text, and a CSV where two bad rows are skipped and the rest of the file is written