Dataset Viewer
The dataset viewer is not available for this dataset.
Unexpected token '<', "<html> <h"... is not valid JSON

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

import json
import os
import datasets

total_cnt=0.
correct_cnt=0.
corrects=[]
for line in open('/shared/storage-01/xp12/mp-llm/MATH/eval_math/pxyyy-Qwen2.5-7B-NuminaMath-CoT-smp20k-ep1-2e-5/math/test_qwen25-math-cot_-1_seed0_t0.0_s0_e-1.jsonl').readlines():
    data = json.loads(line)
    total_cnt+=1
    assert len(data['score'])==1
    correct_cnt+=data['score'][0]
    if data['score'][0]:
        assert data['gt_cot']==data['solution']
        tmp=data
        tmp.pop("gt")
        tmp.pop("level")
        tmp.pop("solution")
        tmp.pop("answer")
        tmp.pop("code")
        tmp.pop("pred")
        tmp.pop("report")
        tmp.pop("score")

        tmp['messages']=[{
            "content": tmp['question'],
            "role": "user"
        },
        {
            "content": tmp['gt_cot'],
            "role": "assistant"
        }]
        corrects.append(data)


print(correct_cnt, total_cnt)
print(correct_cnt/total_cnt)

# print(corrects[0])

dataset = datasets.Dataset.from_list(corrects)
print(dataset)
ds = dataset.shuffle().select(range(2000))

ds.push_to_hub('pxyyy/MATH-Correct-2k')
Downloads last month
6