Skip to content

Commit

Permalink
[Bug] Fix CMB dataset (#1106)
Browse files Browse the repository at this point in the history
  • Loading branch information
bittersweet1999 committed Apr 29, 2024
1 parent 063f5f5 commit 3de48e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion opencompass/datasets/cmb.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ def load(path: str):
for d in val_data:
d['option_str'] = '\n'.join(
[f'{k}. {v}' for k, v in d['option'].items() if len(v) > 1])
d['answer'] = 'NULL'
val_dataset = Dataset.from_list(val_data)

with open(osp.join(path, 'test.json'), 'r', encoding='utf-8') as f:
test_data = json.load(f)
for d in test_data:
d['option_str'] = '\n'.join(
[f'{k}. {v}' for k, v in d['option'].items() if len(v) > 1])
d['answer'] = 'NULL'
test_dataset = Dataset.from_list(test_data)

return DatasetDict({'val': val_dataset, 'test': test_dataset})

0 comments on commit 3de48e9

Please sign in to comment.