Skip to content
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

Treat empty prompts and responses as empty strings #100

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

gordonhart
Copy link
Member

Update the handling of model responses to treat empty prompt or response cells as empty strings, rather than dropping those rows. This means that:

  • Rows with empty response values are treated as if the model did not return anything, and can be evaluated head-to-head like any other response
  • Rows with empty prompt values are treated as if the user did not input anything, meaning one such row is acceptable per model (under the prompt uniqueness constraint) but uploads with multiple empty prompts are rejected due to duplicate values

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.92%. Comparing base (ae9adbf) to head (c53539c).

Additional details and impacted files
@@            Coverage Diff             @@
##            trunk     #100      +/-   ##
==========================================
- Coverage   96.93%   96.92%   -0.01%     
==========================================
  Files          34       34              
  Lines        1467     1464       -3     
==========================================
- Hits         1422     1419       -3     
  Misses         45       45              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gordonhart gordonhart marked this pull request as ready for review October 3, 2024 18:57
@@ -96,13 +96,10 @@ def upload_responses(project_slug: str, model_name: str, df_response: pd.DataFra
raise BadRequestError(str(e))
if len(df_response) == 0:
raise BadRequestError("Responses must not be empty")
df_response = df_response.copy().replace({np.nan: ""})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we ever make use of columns beyond prompt or response, we may want to restrict it to df_response[["prompt", "response"]].

Copy link
Contributor

@marko-polo-cheno marko-polo-cheno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@gordonhart gordonhart merged commit 470f368 into trunk Oct 3, 2024
11 checks passed
@gordonhart gordonhart deleted the gh/empty-responses branch October 3, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants