fix nightly vlm ci : restore original eval for requests without regex (#14875)

This commit is contained in:
Yuhao Yang
2025-12-10 23:13:25 -08:00
committed by GitHub
parent 624725cb5e
commit b62fe8504c
+2 -3
View File
@@ -67,9 +67,7 @@ class MMMUVLMEval(Eval):
# Prepare samples deterministically across all MMMU subjects (validation split) # Prepare samples deterministically across all MMMU subjects (validation split)
self.samples = self._prepare_mmmu_samples(self.num_examples) self.samples = self._prepare_mmmu_samples(self.num_examples)
# For example, "<\|begin_of_box\|>foo<\|end_of_box\|>" could be used to extract "foo" as the answer from the response text # For example, "<\|begin_of_box\|>foo<\|end_of_box\|>" could be used to extract "foo" as the answer from the response text
self.response_answer_regex = ( self.response_answer_regex = response_answer_regex
response_answer_regex if response_answer_regex is not None else "(.*)"
)
@staticmethod @staticmethod
def _to_data_uri(image: Image.Image) -> str: def _to_data_uri(image: Image.Image) -> str:
@@ -214,6 +212,7 @@ class MMMUVLMEval(Eval):
# Sample # Sample
response_text = sampler(prompt_messages) response_text = sampler(prompt_messages)
response_text = response_text or "" response_text = response_text or ""
if self.response_answer_regex:
match = ( match = (
re.search(self.response_answer_regex, response_text) re.search(self.response_answer_regex, response_text)
if response_text is not None if response_text is not None