Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Fix detect_offensive_language script #4054

Merged
merged 5 commits into from
Mar 31, 2022
Merged

Fix detect_offensive_language script #4054

merged 5 commits into from
Mar 31, 2022

Conversation

klshuster
Copy link
Contributor

Patch description
The script would break if the labels or text fields within a task were empty strings; this fixes that.

I'm not really sure who to tag on this as a reviewer so lmk if someone else should review.

Testing steps
See #4049 for task that breaks the script. I've also added a new test to confirm this works.

@@ -81,6 +81,8 @@ def report(world, stats):
return log

def classify(text, stats):
if not text:
Copy link
Contributor

Choose a reason for hiding this comment

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

i wonder if the right answer here is to just make our utils in utils/safety.py robust to empty text

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's fair, would catch it at the source...

@klshuster
Copy link
Contributor Author

Updated the PR to make utils/safety.py robust to empty text

@github-actions
Copy link

This PR has not had activity in 30 days. Closing due to staleness.

@github-actions github-actions bot added the stale label Nov 14, 2021
@klshuster klshuster added donotreap Avoid automatically marking as stale. and removed stale labels Nov 15, 2021
@klshuster
Copy link
Contributor Author

bump

@klshuster
Copy link
Contributor Author

bump

Copy link
Contributor

@stephenroller stephenroller left a comment

Choose a reason for hiding this comment

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

oct 2021?!

@klshuster klshuster merged commit e98b860 into main Mar 31, 2022
@klshuster klshuster deleted the fix_detect_OL_script branch March 31, 2022 13:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed donotreap Avoid automatically marking as stale.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants