Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Evals] support kwargs in eval all samples #680

Merged
merged 1 commit into from
Apr 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
support kwargs in eval all samples
  • Loading branch information
andrew-openai committed Apr 14, 2023
commit 7a8eb5a5cb3495f51940acca95431b398cb4d646
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)