-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheval.py
More file actions
44 lines (36 loc) · 1.15 KB
/
eval.py
File metadata and controls
44 lines (36 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import argparse
from utils.format import get_enum
from evaluate.evaluate import evaluate_solution
def parse_eval() -> argparse.Namespace:
parser = argparse.ArgumentParser(description="Apply perturbations to code samples.")
parser.add_argument(
"--filepath",
type=str,
required=True,
help="Path to the JSONL file containing code samples.",
)
parser.add_argument(
"--task",
type=str,
choices=["input", "output"],
required=True,
help="Task type: 'input' for input prediction, 'output' for output prediction.",
)
parser.add_argument(
"--max-workers",
type=int,
default=10,
help="Maximum number of parallel workers.",
)
args = parser.parse_args()
return args
if __name__ == "__main__":
args = parse_eval()
task = get_enum(args.task)
print("======================== Evaluating Solutions ========================")
evaluate_solution(
filepath=args.filepath,
task=task,
max_workers=args.max_workers
)
print("======================================================================")