-
Notifications
You must be signed in to change notification settings - Fork 336
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
feat(evals): return partial results when llm function is interrupted #1755
Conversation
return pd.DataFrame( | ||
data={ | ||
"label": labels, | ||
**({"explanation": explanations} if provide_explanation else {}), | ||
**({"explanation": cast(List[str], explanations)} if provide_explanation else {}), |
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.
not sure if mypy shifted but just casting for now as it should be pretty guaranteed. Can add fallbacks above too instead
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.
it worked for me without the cast
(even after hatch env remove type
)
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
cd150be
to
086697d
Compare
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.
LGTM
return pd.DataFrame( | ||
data={ | ||
"label": labels, | ||
**({"explanation": explanations} if provide_explanation else {}), | ||
**({"explanation": cast(List[str], explanations)} if provide_explanation else {}), |
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.
it worked for me without the cast
(even after hatch env remove type
)
rails=["relevant", "irrelevant"], | ||
) | ||
|
||
assert classification_df is not None |
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.
could be more specific
assert classification_df is not None | |
assert classification_df.isna().sum() == 2 |
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.
I was foreshadowing the async submission change. Gonna leave it less specific to future proof
Co-authored-by: Roger Yang <[email protected]>
Co-authored-by: Roger Yang <[email protected]>
resolves #1748
Adds a try / catch block around the generation step of the llm functions so that the partial results can be outputted. This is important since we don't want the user to lose the progress they make - notably because it costs money.