-
Notifications
You must be signed in to change notification settings - Fork 15.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add tests to trajectory eval chain #8909
add tests to trajectory eval chain #8909
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
) # Scan for first digit | ||
|
||
if not 1 <= int(score_str) <= 5: | ||
# Use regex to extract the score |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Would be useful to document the intended behavior to help verify implementation.
Is the reason for the change to change missing score into a None rather than a 0
?
If so, could we keep the previous logic and replace like so:
score_str = next(
(char for char in score_str if char.isdigit()), None
) # Scan for first digit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This change is intended to take care of cases where LLM makes invalid score like 1.1 or 20.
next((char for char in score_str if char.isdigit()), None)
will return "1" for 1.1 and "2" for 20 which is invalid score.
My change will validate these case as error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added explanation on the code comment.
Thanks for the change and the tests. Do you mind including somewhere an explanation of what behavior this PR modifies? |
What