@@ -118,8 +118,8 @@ class AutomatedMetricTester:
118118 "truthfulqa_mc_metrics" : Metrics .truthfulqa_mc_metrics ,
119119 # "faithfulness": Metrics.faithfulness, # need GPU to run
120120 # "bert_score": Metrics.bert_score, issue with the scoring function, int too big to convert
121+ # "simpleqa_judge": Metrics.simpleqa_judge, # Need to setup for compute costs
121122 "prediction_perplexity" : Metrics .prediction_perplexity ,
122- # "simpleqa_judge": Metrics.simpleqa_judge, Batched metrics not supported yet
123123 "bleu" : Metrics .bleu ,
124124 "bleu_1" : Metrics .bleu_1 ,
125125 "bleu_4" : Metrics .bleu_4 ,
@@ -219,15 +219,27 @@ def run_test_case(self, test_case: MetricTestCase | CorpusLevelMetricTestCase) -
219219 doc = self .create_doc_from_dict (test_case .doc )
220220 model_response = self .create_model_response_from_dict (test_case .model_response )
221221
222- # Create sample_params for the metric
223- sample_params = {
224- "doc" : doc ,
225- "model_response" : model_response ,
226- }
222+ # Check if this is a batched metric
223+ if hasattr (metric , "batched_compute" ) and metric .batched_compute :
224+ # For batched metrics, we need to pass lists of docs and responses
225+ sample_params = {
226+ "docs" : [doc ],
227+ "responses" : [model_response ],
228+ }
229+ else :
230+ # For non-batched metrics, use individual doc and model_response
231+ sample_params = {
232+ "doc" : doc ,
233+ "model_response" : model_response ,
234+ }
227235
228236 # Run the metric using the Metrics enum value
229237 actual_output = metric .compute_sample (** sample_params )
230238
239+ # For batched metrics, extract the first result since we're only testing with one sample
240+ if hasattr (metric , "batched_compute" ) and metric .batched_compute and isinstance (actual_output , list ):
241+ actual_output = actual_output [0 ]
242+
231243 # Compare with expected output
232244 success = self ._compare_dict_outputs (actual_output , test_case .expected_output , test_case .tolerance )
233245 return {
0 commit comments