Skip to content

Commit

Permalink
reformat files
Browse files Browse the repository at this point in the history
  • Loading branch information
eliyahabba committed Feb 2, 2025
1 parent 2166a45 commit 52d0022
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions prepare/cards/global_mmlu_lite_ca.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,11 @@
with settings.context(allow_unverified_code=True):
for language in languages:
card = TaskCard(
loader=LoadHF(path="CohereForAI/Global-MMLU-Lite", name=language,
filtering_lambda=f"lambda x: x['cultural_sensitivity_label'] == 'CA'"),
loader=LoadHF(
path="CohereForAI/Global-MMLU-Lite",
name=language,
filtering_lambda=f"lambda x: x['cultural_sensitivity_label'] == 'CA'",
),
preprocess_steps=[
SplitRandomMix({"test": "test[100%]", "train": "test[10%]"}),
Deduplicate(by=["question", "subject", "answer"]),
Expand All @@ -114,9 +117,7 @@
to_field="choices",
),
Rename(field_to_field={"subject": "topic"}),
MapInstanceValues(
mappers={"topic": subject_mapping}
),
MapInstanceValues(mappers={"topic": subject_mapping}),
],
task="tasks.qa.multiple_choice.with_topic",
templates="templates.qa.multiple_choice.with_topic.all",
Expand Down
11 changes: 6 additions & 5 deletions prepare/cards/global_mmlu_lite_cs.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,11 @@
with settings.context(allow_unverified_code=True):
for language in languages:
card = TaskCard(
loader=LoadHF(path="CohereForAI/Global-MMLU-Lite", name=language,
filtering_lambda=f"lambda x: x['cultural_sensitivity_label'] == 'CS'"),
loader=LoadHF(
path="CohereForAI/Global-MMLU-Lite",
name=language,
filtering_lambda=f"lambda x: x['cultural_sensitivity_label'] == 'CS'",
),
preprocess_steps=[
SplitRandomMix({"test": "test[100%]", "train": "test[10%]"}),
Deduplicate(by=["question", "subject", "answer"]),
Expand All @@ -114,9 +117,7 @@
to_field="choices",
),
Rename(field_to_field={"subject": "topic"}),
MapInstanceValues(
mappers={"topic": subject_mapping}
),
MapInstanceValues(mappers={"topic": subject_mapping}),
],
task="tasks.qa.multiple_choice.with_topic",
templates="templates.qa.multiple_choice.with_topic.all",
Expand Down

0 comments on commit 52d0022

Please sign in to comment.