-
Notifications
You must be signed in to change notification settings - Fork 129
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
Pass@k #519
base: main
Are you sure you want to change the base?
Pass@k #519
Conversation
strip_strings: bool = False, | ||
sample_scoring_function: Union[Callable[[str, str], float], str] = None, | ||
): | ||
"""Computing pass at k |
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 made it as exhaustive/customizable as the other metrics (full exact match for the individual predictions by default, options to normalize strings in case you use it for math evals for ex) but I can remove some options if you feel that's too much complexity
self.score_sample = self.default_sample_scoring | ||
|
||
def compute(self, golds: list[str], predictions: list[str], **kwargs) -> dict[str, float]: | ||
"""Computes the metric over a list of golds and predictions for one single item with possibly many samples. |
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.
Core logic here
return 1 if gold == pred else 0 | ||
|
||
def pass_at_k(self, all_scores: list[int]) -> float: | ||
"""Algo from https://arxiv.org/pdf/2107.03374""" |
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.
Pass at K here, literally the one from codex
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Wouldn't be the best to make it dynamic ? |
You would be able to create a custom metric like so, with a custom sample level metric:
unless you need stg else? |
Ahhh I missed that arg, good by me, thought it was exclusively for string to string comparison |
No description provided.