From ec1f6078702acdcd051cb89c38180b26b0710dc9 Mon Sep 17 00:00:00 2001 From: Kento Nozawa Date: Tue, 30 Sep 2025 17:30:16 +0900 Subject: [PATCH 1/3] Fix RepeatPhraseChecker constraints --- open_instruct/IFEvalG/instructions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/open_instruct/IFEvalG/instructions.py b/open_instruct/IFEvalG/instructions.py index c2109a00ef..80415bbb83 100644 --- a/open_instruct/IFEvalG/instructions.py +++ b/open_instruct/IFEvalG/instructions.py @@ -1548,6 +1548,7 @@ def check_following(self, value): found_phrases = re.findall(rf"{first_word} .*? {last_word}", value) if len(found_phrases) != self._small_n: return False + num_satisfied_phrases = 0 for phrase in found_phrases: phrase = phrase.split() ref_phrase = self._phrase.split() @@ -1563,8 +1564,9 @@ def check_following(self, value): return False except IndexError: return False - if differences == 1: - return True + num_satisfied_phrases += 1 + + return num_satisfied_phrases == self._small_n class CopyChecker(Instruction): From cad4c867b86921f932da639bd4d67ed44f0aebc3 Mon Sep 17 00:00:00 2001 From: Kento Nozawa Date: Tue, 30 Sep 2025 17:34:11 +0900 Subject: [PATCH 2/3] my bad --- open_instruct/IFEvalG/instructions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open_instruct/IFEvalG/instructions.py b/open_instruct/IFEvalG/instructions.py index 80415bbb83..5a8161b3fa 100644 --- a/open_instruct/IFEvalG/instructions.py +++ b/open_instruct/IFEvalG/instructions.py @@ -1564,7 +1564,7 @@ def check_following(self, value): return False except IndexError: return False - num_satisfied_phrases += 1 + num_satisfied_phrases += differences == 1 return num_satisfied_phrases == self._small_n From 7462f934a09c4b723f65a35e2a912dd5be990049 Mon Sep 17 00:00:00 2001 From: Kento Nozawa Date: Tue, 30 Sep 2025 17:36:57 +0900 Subject: [PATCH 3/3] Remove unnecessary line --- open_instruct/IFEvalG/instructions.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/open_instruct/IFEvalG/instructions.py b/open_instruct/IFEvalG/instructions.py index 5a8161b3fa..16d574a54e 100644 --- a/open_instruct/IFEvalG/instructions.py +++ b/open_instruct/IFEvalG/instructions.py @@ -1543,8 +1543,6 @@ def check_following(self, value): first_word = self._phrase.split()[0] last_word = self._phrase.split()[-1] - len(self._phrase.split()) - 2 - found_phrases = re.findall(rf"{first_word} .*? {last_word}", value) if len(found_phrases) != self._small_n: return False