-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mmuu): add dataset loading and configuration for MMMU task
- Loading branch information
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import datasets | ||
from datasets import load_dataset | ||
|
||
|
||
def gen(): | ||
data = load_dataset("lmms-lab/MMMU") | ||
yield from data["dev"] | ||
yield from data["validation"] | ||
|
||
|
||
final_data = datasets.Dataset.from_generator(gen) | ||
|
||
final_data.push_to_hub("pufanyi/MMMU", split="validation") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
dataset_path: pufanyi/MMMU | ||
task: "mmmu_dev_val" | ||
test_split: validation | ||
output_type: generate_until | ||
doc_to_visual: !function utils.mmmu_doc_to_visual | ||
doc_to_text: !function utils.mmmu_doc_to_text | ||
doc_to_target: "answer" | ||
# The return value of process_results will be used by metrics | ||
process_results: !function utils.mmmu_process_results | ||
|
||
metric_list: | ||
- metric: mmmu_acc | ||
aggregation: !function utils.mmmu_aggregate_results | ||
higher_is_better: true | ||
|
||
include: _default_template_yaml |