Skip to content

Commit

Permalink
Fix template import in WildBenchAnnotator (#3231)
Browse files Browse the repository at this point in the history
  • Loading branch information
yifanmai authored Dec 20, 2024
1 parent 1bf82b4 commit c28a842
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ recursive-include src/helm/benchmark/static/ *.css *.html *.js *.png *.yaml
recursive-include src/helm/benchmark/static_build/ *.css *.html *.js *.png *.yaml
recursive-include src/helm/config/ *.yaml
recursive-include src/helm/benchmark/annotation/omni_math/ *.txt
recursive-include src/helm/benchmark/annotation/wildbench/ *.md
4 changes: 3 additions & 1 deletion src/helm/benchmark/annotation/wildbench_annotator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import re
from typing import Any
from importlib.resources import files

from helm.benchmark.adaptation.request_state import RequestState
from helm.benchmark.annotation.annotator import Annotator
Expand All @@ -14,7 +15,8 @@ class WildBenchAnnotator(Annotator):

def __init__(self, auto_client: AutoClient):
self._auto_client = auto_client
with open("src/helm/benchmark/annotation/wildbench/eval_template.score.v2.md") as f:
template_path = files("src.helm.benchmark.annotation.wildbench").joinpath("eval_template.score.v2.md")
with template_path.open("r") as f:
self._score_template = f.read()
self._pattern = re.compile(
r'"strengths"\s*:\s*"(.*?)"\s*,\s*"weaknesses"\s*:\s*"(.*?)"\s*,\s*"score"\s*:\s*(".*?"|\d+)', re.DOTALL
Expand Down

0 comments on commit c28a842

Please sign in to comment.