From 11e7334d07996894ef12bfde51844da0b7802971 Mon Sep 17 00:00:00 2001 From: Jialiang Xu Date: Sat, 14 Dec 2024 23:26:25 -0800 Subject: [PATCH] satisfying type checker --- src/helm/benchmark/annotation/annotator.py | 2 +- src/helm/benchmark/annotation_executor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helm/benchmark/annotation/annotator.py b/src/helm/benchmark/annotation/annotator.py index 4f48a82c06..fe835fb3ee 100644 --- a/src/helm/benchmark/annotation/annotator.py +++ b/src/helm/benchmark/annotation/annotator.py @@ -23,7 +23,7 @@ def annotate(self, request_state: RequestState) -> Any: def annotate_all(self, request_states: List[RequestState]) -> List[Dict[str, Any]]: """Fills the annotations field of all request states with additional information that are implementation specific.""" - pass + return [self.annotate(request_state) for request_state in request_states] @dataclass(frozen=True) diff --git a/src/helm/benchmark/annotation_executor.py b/src/helm/benchmark/annotation_executor.py index f908e38cf1..c82143608b 100644 --- a/src/helm/benchmark/annotation_executor.py +++ b/src/helm/benchmark/annotation_executor.py @@ -141,5 +141,5 @@ def process_all(self, annotator_specs: List[AnnotatorSpec], states: List[Request new_annotations = annotator.annotate_all(states) annotations[annotator.name] = new_annotations except Exception as e: - raise AnnotationExecutorError(f"{str(e)} Request: {states.request}") from e + raise AnnotationExecutorError(f"{str(e)} Request: {[state.request for state in states]}") from e return [replace(state, annotations=new_annotations[idx]) for idx, state in enumerate(states)]