MCPcopy Create free account
hub / github.com/PRIME-RL/PRIME / read_dataset

Function read_dataset

eval/utils/evaluation_leetcode.py:68–83  ·  view source on GitHub ↗
(
    data_file: str = None,
    dataset_type: str = "humaneval",
    num_shot=None,
)

Source from the content-addressed store, hash-verified

66
67
68def read_dataset(
69 data_file: str = None,
70 dataset_type: str = "humaneval",
71 num_shot=None,
72) -> Dict:
73 if num_shot is not None:
74 print(f"{num_shot}-shot setting...")
75 if "humaneval" in dataset_type.lower():
76 if data_file is None:
77 current_path = os.path.dirname(os.path.abspath(__file__))
78 data_file = os.path.join(current_path, "..", "humaneval-x", "python", "data", "humaneval_python.jsonl.gz")
79 dataset = {task["task_id"]: task for task in stream_jsonl(data_file)}
80 else:
81 raise f"Dataset: {dataset_type} not supported."
82
83 return dataset
84
85def estimate_pass_at_k(
86 num_samples: Union[int, List[int], np.ndarray],

Callers 1

Calls 1

stream_jsonlFunction · 0.85

Tested by

no test coverage detected