Skip to content

Commit

Permalink
[Evals] support kwargs in eval all samples (openai#680)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-openai committed Apr 14, 2023
1 parent e8b8e72 commit 30b4630
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions evals/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

from evals.api import CompletionFn

from .data import get_jsonl
from .record import RecorderBase
from .registry import Registry
from .data import get_jsonl

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -88,6 +88,7 @@ async def async_eval_all_samples(
samples: List[Any],
concurrency: int = 32,
show_progress: bool = True,
**_kwargs: Any,
):
work_items = _index_samples(samples)
semaphore = asyncio.Semaphore(concurrency)
Expand All @@ -109,6 +110,7 @@ def eval_all_samples(
samples,
show_progress=True,
record_raw_sample=True,
**_kwargs: Any,
):
"""
Evaluate all provided samples in parallel.
Expand Down Expand Up @@ -156,7 +158,7 @@ def worker_thread(args):
def get_samples(self):
if self.samples_jsonl is None:
raise ValueError(
"To use `get_samples`, you must provide a `samples_jsonl` path."
"Got `None`.")
"To use `get_samples`, you must provide a `samples_jsonl` path." "Got `None`."
)

return get_jsonl(self.samples_jsonl)

0 comments on commit 30b4630

Please sign in to comment.