MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / parse

Function parse

test/gsm8k/eval.py:79–87  ·  view source on GitHub ↗
(lines)

Source from the content-addressed store, hash-verified

77 return all_ans
78
79def parse(lines):
80 all_ans = []
81 for line in lines:
82 try:
83 ans = extract_answer_wizard(json.loads(line)[0][1])
84 except BaseException:
85 ans = extract_answer_wizard(json.loads(line)['gen'][0])
86 all_ans.append(ans)
87 return all_ans
88
89def eval_json(json_path, mode='test'):
90 if json_path.endswith('/') or not json_path.endswith('json'):

Callers 4

eval_jsonFunction · 0.85
eval_majority_votingFunction · 0.85

Calls 1

extract_answer_wizardFunction · 0.85

Tested by

no test coverage detected