MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / read_dataset

Function read_dataset

codegeex/benchmark/utils.py:51–66  ·  view source on GitHub ↗
(
    data_file: str = None,
    dataset_type: str = "humaneval",
    num_shot=None,
)

Source from the content-addressed store, hash-verified

49
50
51def read_dataset(
52 data_file: str = None,
53 dataset_type: str = "humaneval",
54 num_shot=None,
55) -> Dict:
56 if num_shot is not None:
57 print(f"{num_shot}-shot setting...")
58 if "humaneval" in dataset_type.lower():
59 if data_file is None:
60 current_path = os.path.dirname(os.path.abspath(__file__))
61 data_file = os.path.join(current_path, "..", "humaneval-x", "python", "data", "humaneval_python.jsonl.gz")
62 dataset = {task["task_id"]: task for task in stream_jsonl(data_file)}
63 else:
64 raise f"Dataset: {dataset_type} not supported."
65
66 return dataset
67
68
69def read_translation_dataset(

Callers 3

serverFunction · 0.90

Calls 1

stream_jsonlFunction · 0.90

Tested by

no test coverage detected