Skip to content

Commit

Permalink
Seperated out individual run commands for each child class
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Weinberg <[email protected]>
  • Loading branch information
nathan-weinberg committed Jun 14, 2024
1 parent f62821a commit 8f1eb48
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/instructlab/eval/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,3 @@ class Evaluator:

def __init__(self, model: str) -> None:
self.model = model

def run(self) -> dict:
return {}
20 changes: 20 additions & 0 deletions src/instructlab/eval/mmlu.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ def __init__(
self.fewshots = fewshots
self.batchsize = batchsize

def run(self) -> dict:
individual_scores: dict[str, float] = {}
overall_score: float = 0.0
payload = {
"individual_scores": individual_scores,
"overall_score": overall_score,
}
return payload


class PR_MMLU_Evaluator(Evaluator):
"""
Expand All @@ -47,3 +56,14 @@ def __init__(
self.task = task
self.fewshots = fewshots
self.batchsize = batchsize

def run(self) -> dict:
individual_scores: dict[str, float] = {}
overall_score: float = 0.0
qa_pairs: list[tuple] = []
payload = {
"individual_scores": individual_scores,
"overall_score": overall_score,
"qa_pairs": qa_pairs,
}
return payload
12 changes: 12 additions & 0 deletions src/instructlab/eval/mtbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ def __init__(self, model, server_url: str) -> None:
super().__init__(model)
self.server_url = server_url

def run(self) -> dict:
overall_score = 0.0
qa_pairs: list[tuple] = []
payload = {"overall_score": overall_score, "qa_pairs": qa_pairs}
return payload


class PR_Bench_Evaluator(Evaluator):
"""
Expand All @@ -30,3 +36,9 @@ def __init__(self, model, server_url: str, questions: str) -> None:
super().__init__(model)
self.server_url = server_url
self.questions = questions

def run(self) -> dict:
overall_score = 0.0
qa_pairs: list[tuple] = []
payload = {"overall_score": overall_score, "qa_pairs": qa_pairs}
return payload

0 comments on commit 8f1eb48

Please sign in to comment.