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

fix: IFEval dataset introduces the correct langdetect expectation path #1451

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions opencompass/datasets/IFEval/instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def check_following(self, value):

try:
return langdetect.detect(value) == self._language
except langdetect.LangDetectException as e:
except langdetect.lang_detect_exception.LangDetectException as e:
# Count as instruction is followed.
logging.error('Unable to detect language for text %s due to %s',
value, e) # refex: disable=pytotw.037
Expand Down Expand Up @@ -1424,7 +1424,7 @@ def check_following(self, value):

try:
return value.isupper() and langdetect.detect(value) == 'en'
except langdetect.LangDetectException as e:
except langdetect.lang_detect_exception.LangDetectException as e:
# Count as instruction is followed.
logging.error('Unable to detect language for text %s due to %s',
value, e) # refex: disable=pytotw.037
Expand Down Expand Up @@ -1456,7 +1456,7 @@ def check_following(self, value):

try:
return value.islower() and langdetect.detect(value) == 'en'
except langdetect.LangDetectException as e:
except langdetect.lang_detect_exception.LangDetectException as e:
# Count as instruction is followed.
logging.error('Unable to detect language for text %s due to %s',
value, e) # refex: disable=pytotw.037
Expand Down
Loading