Repository navigation
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This branch has not been deployed
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.
Watsonx continuation scoring compares the last token of the entire response with the last context token. For a non-empty continuation, this can incorrectly shorten the context by one token, include a prompt log probability in the answer score, and change the greedy-match result.
Compare at the context boundary instead, including the empty-context and tokenizer-added stop-token cases. Add ten offline regression cases for likelihood, greedy matching, empty continuations, and prefix mismatches. Four existing exception re-raises in the touched module use bare
raiseto satisfy the current pre-commit rules.A minimal reproduction on main (
d6de8164):Before:
LogLikelihoodResult(log_likelihood=-9.25, is_greedy=False).After:
LogLikelihoodResult(log_likelihood=-0.25, is_greedy=True).Validation: the new test file has 5 failures and 5 passes on unchanged main, and all 10 cases pass with this fix.
pytest tests/models/test_watsonx_loglikelihood.py -qand the repository's pre-commit hooks pass. Tests use recorded-response-shaped inputs without an SDK client, API credentials, network access or model downloads. Live Watsonx integration and the full model test suite were not run.Related to #1613.