MCPcopy Create free account
hub / github.com/InternScience/SciReason / read_jsonl

Function read_jsonl

opencompass/datasets/agieval/utils.py:5–18  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

3
4
5def read_jsonl(path):
6 with open(path, encoding='utf8') as fh:
7 results = []
8 for line in fh:
9 if line is None:
10 continue
11 try:
12 results.append(json.loads(line) if line != 'null' else line)
13 except Exception as e:
14 print(e)
15 print(path)
16 print(line)
17 raise e
18 return results
19
20
21def save_jsonl(lines, directory):

Callers 2

load_datasetFunction · 0.70

Calls 1

openFunction · 0.85

Tested by

no test coverage detected