Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
lm-evaluation-harness
Commits
0b45cc71
Unverified
Commit
0b45cc71
authored
Aug 26, 2025
by
Weihao XUAN
Committed by
GitHub
Aug 25, 2025
Browse files
Update MMLU-ProX task (#3174)
* update MMLU_ProX * update MMLU_ProX * cleanup code by pre-commit
parent
05b37f20
Changes
741
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
321 additions
and
0 deletions
+321
-0
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_chemistry.yaml
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_chemistry.yaml
+9
-0
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_computer_science.yaml
...val/tasks/mmlu_prox/ur/mmlu_prox_ur_computer_science.yaml
+9
-0
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_economics.yaml
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_economics.yaml
+9
-0
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_engineering.yaml
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_engineering.yaml
+9
-0
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_health.yaml
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_health.yaml
+9
-0
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_history.yaml
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_history.yaml
+9
-0
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_law.yaml
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_law.yaml
+9
-0
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_math.yaml
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_math.yaml
+9
-0
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_other.yaml
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_other.yaml
+9
-0
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_philosophy.yaml
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_philosophy.yaml
+9
-0
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_physics.yaml
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_physics.yaml
+9
-0
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_psychology.yaml
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_psychology.yaml
+9
-0
lm_eval/tasks/mmlu_prox/ur/utils.py
lm_eval/tasks/mmlu_prox/ur/utils.py
+70
-0
lm_eval/tasks/mmlu_prox/vi/_mmlu_prox_lite_vi.yaml
lm_eval/tasks/mmlu_prox/vi/_mmlu_prox_lite_vi.yaml
+23
-0
lm_eval/tasks/mmlu_prox/vi/_mmlu_prox_vi.yaml
lm_eval/tasks/mmlu_prox/vi/_mmlu_prox_vi.yaml
+23
-0
lm_eval/tasks/mmlu_prox/vi/_vi_lite_template_yaml
lm_eval/tasks/mmlu_prox/vi/_vi_lite_template_yaml
+35
-0
lm_eval/tasks/mmlu_prox/vi/_vi_template_yaml
lm_eval/tasks/mmlu_prox/vi/_vi_template_yaml
+35
-0
lm_eval/tasks/mmlu_prox/vi/mmlu_prox_lite_vi_biology.yaml
lm_eval/tasks/mmlu_prox/vi/mmlu_prox_lite_vi_biology.yaml
+9
-0
lm_eval/tasks/mmlu_prox/vi/mmlu_prox_lite_vi_business.yaml
lm_eval/tasks/mmlu_prox/vi/mmlu_prox_lite_vi_business.yaml
+9
-0
lm_eval/tasks/mmlu_prox/vi/mmlu_prox_lite_vi_chemistry.yaml
lm_eval/tasks/mmlu_prox/vi/mmlu_prox_lite_vi_chemistry.yaml
+9
-0
No files found.
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_chemistry.yaml
0 → 100644
View file @
0b45cc71
description
:
'
درج
ذیل
کیمیا
کے
متعلق
ایک
متعدد
انتخابی
سوال
ہے
(جوابات
کے
ساتھ)۔
براہ
کرم
قدم
بہ
قدم
سوچیں،
اور
پھر
اپنے
جواب
کو
"جواب
(X)
ہے"
کے
ساتھ
ختم
کریں،
جہاں
X
درست
آپشن
کا
حرف
ہے۔
'
include
:
_ur_template_yaml
task
:
mmlu_prox_ur_chemistry
task_alias
:
chemistry
process_docs
:
!function
utils.process_chemistry
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_computer_science.yaml
0 → 100644
View file @
0b45cc71
description
:
'
درج
ذیل
کمپیوٹر
سائنس
کے
متعلق
ایک
متعدد
انتخابی
سوال
ہے
(جوابات
کے
ساتھ)۔
براہ
کرم
قدم
بہ
قدم
سوچیں،
اور
پھر
اپنے
جواب
کو
"جواب
(X)
ہے"
کے
ساتھ
ختم
کریں،
جہاں
X
درست
آپشن
کا
حرف
ہے۔
'
include
:
_ur_template_yaml
task
:
mmlu_prox_ur_computer_science
task_alias
:
computer_science
process_docs
:
!function
utils.process_computer_science
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_economics.yaml
0 → 100644
View file @
0b45cc71
description
:
'
درج
ذیل
معاشیات
کے
متعلق
ایک
متعدد
انتخابی
سوال
ہے
(جوابات
کے
ساتھ)۔
براہ
کرم
قدم
بہ
قدم
سوچیں،
اور
پھر
اپنے
جواب
کو
"جواب
(X)
ہے"
کے
ساتھ
ختم
کریں،
جہاں
X
درست
آپشن
کا
حرف
ہے۔
'
include
:
_ur_template_yaml
task
:
mmlu_prox_ur_economics
task_alias
:
economics
process_docs
:
!function
utils.process_economics
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_engineering.yaml
0 → 100644
View file @
0b45cc71
description
:
'
درج
ذیل
انجینئرنگ
کے
متعلق
ایک
متعدد
انتخابی
سوال
ہے
(جوابات
کے
ساتھ)۔
براہ
کرم
قدم
بہ
قدم
سوچیں،
اور
پھر
اپنے
جواب
کو
"جواب
(X)
ہے"
کے
ساتھ
ختم
کریں،
جہاں
X
درست
آپشن
کا
حرف
ہے۔
'
include
:
_ur_template_yaml
task
:
mmlu_prox_ur_engineering
task_alias
:
engineering
process_docs
:
!function
utils.process_engineering
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_health.yaml
0 → 100644
View file @
0b45cc71
description
:
'
درج
ذیل
صحت
کے
متعلق
ایک
متعدد
انتخابی
سوال
ہے
(جوابات
کے
ساتھ)۔
براہ
کرم
قدم
بہ
قدم
سوچیں،
اور
پھر
اپنے
جواب
کو
"جواب
(X)
ہے"
کے
ساتھ
ختم
کریں،
جہاں
X
درست
آپشن
کا
حرف
ہے۔
'
include
:
_ur_template_yaml
task
:
mmlu_prox_ur_health
task_alias
:
health
process_docs
:
!function
utils.process_health
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_history.yaml
0 → 100644
View file @
0b45cc71
description
:
'
درج
ذیل
تاریخ
کے
متعلق
ایک
متعدد
انتخابی
سوال
ہے
(جوابات
کے
ساتھ)۔
براہ
کرم
قدم
بہ
قدم
سوچیں،
اور
پھر
اپنے
جواب
کو
"جواب
(X)
ہے"
کے
ساتھ
ختم
کریں،
جہاں
X
درست
آپشن
کا
حرف
ہے۔
'
include
:
_ur_template_yaml
task
:
mmlu_prox_ur_history
task_alias
:
history
process_docs
:
!function
utils.process_history
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_law.yaml
0 → 100644
View file @
0b45cc71
description
:
'
درج
ذیل
قانون
کے
متعلق
ایک
متعدد
انتخابی
سوال
ہے
(جوابات
کے
ساتھ)۔
براہ
کرم
قدم
بہ
قدم
سوچیں،
اور
پھر
اپنے
جواب
کو
"جواب
(X)
ہے"
کے
ساتھ
ختم
کریں،
جہاں
X
درست
آپشن
کا
حرف
ہے۔
'
include
:
_ur_template_yaml
task
:
mmlu_prox_ur_law
task_alias
:
law
process_docs
:
!function
utils.process_law
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_math.yaml
0 → 100644
View file @
0b45cc71
description
:
'
درج
ذیل
ریاضی
کے
متعلق
ایک
متعدد
انتخابی
سوال
ہے
(جوابات
کے
ساتھ)۔
براہ
کرم
قدم
بہ
قدم
سوچیں،
اور
پھر
اپنے
جواب
کو
"جواب
(X)
ہے"
کے
ساتھ
ختم
کریں،
جہاں
X
درست
آپشن
کا
حرف
ہے۔
'
include
:
_ur_template_yaml
task
:
mmlu_prox_ur_math
task_alias
:
math
process_docs
:
!function
utils.process_math
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_other.yaml
0 → 100644
View file @
0b45cc71
description
:
'
درج
ذیل
دیگر
کے
متعلق
ایک
متعدد
انتخابی
سوال
ہے
(جوابات
کے
ساتھ)۔
براہ
کرم
قدم
بہ
قدم
سوچیں،
اور
پھر
اپنے
جواب
کو
"جواب
(X)
ہے"
کے
ساتھ
ختم
کریں،
جہاں
X
درست
آپشن
کا
حرف
ہے۔
'
include
:
_ur_template_yaml
task
:
mmlu_prox_ur_other
task_alias
:
other
process_docs
:
!function
utils.process_other
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_philosophy.yaml
0 → 100644
View file @
0b45cc71
description
:
'
درج
ذیل
فلسفہ
کے
متعلق
ایک
متعدد
انتخابی
سوال
ہے
(جوابات
کے
ساتھ)۔
براہ
کرم
قدم
بہ
قدم
سوچیں،
اور
پھر
اپنے
جواب
کو
"جواب
(X)
ہے"
کے
ساتھ
ختم
کریں،
جہاں
X
درست
آپشن
کا
حرف
ہے۔
'
include
:
_ur_template_yaml
task
:
mmlu_prox_ur_philosophy
task_alias
:
philosophy
process_docs
:
!function
utils.process_philosophy
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_physics.yaml
0 → 100644
View file @
0b45cc71
description
:
'
درج
ذیل
طبیعیات
کے
متعلق
ایک
متعدد
انتخابی
سوال
ہے
(جوابات
کے
ساتھ)۔
براہ
کرم
قدم
بہ
قدم
سوچیں،
اور
پھر
اپنے
جواب
کو
"جواب
(X)
ہے"
کے
ساتھ
ختم
کریں،
جہاں
X
درست
آپشن
کا
حرف
ہے۔
'
include
:
_ur_template_yaml
task
:
mmlu_prox_ur_physics
task_alias
:
physics
process_docs
:
!function
utils.process_physics
lm_eval/tasks/mmlu_prox/ur/mmlu_prox_ur_psychology.yaml
0 → 100644
View file @
0b45cc71
description
:
'
درج
ذیل
نفسیات
کے
متعلق
ایک
متعدد
انتخابی
سوال
ہے
(جوابات
کے
ساتھ)۔
براہ
کرم
قدم
بہ
قدم
سوچیں،
اور
پھر
اپنے
جواب
کو
"جواب
(X)
ہے"
کے
ساتھ
ختم
کریں،
جہاں
X
درست
آپشن
کا
حرف
ہے۔
'
include
:
_ur_template_yaml
task
:
mmlu_prox_ur_psychology
task_alias
:
psychology
process_docs
:
!function
utils.process_psychology
lm_eval/tasks/mmlu_prox/ur/utils.py
0 → 100644
View file @
0b45cc71
from
functools
import
partial
from
os.path
import
basename
,
dirname
from
lm_eval.tasks.mmlu_prox.lang_libs
import
LANG_LIBS
lang_abbr
=
basename
(
dirname
(
__file__
))
lang_dict
=
LANG_LIBS
[
lang_abbr
]
choices
=
[
"A"
,
"B"
,
"C"
,
"D"
,
"E"
,
"F"
,
"G"
,
"H"
,
"I"
,
"J"
,
"K"
,
"L"
,
"M"
,
"N"
,
"O"
,
"P"
,
]
max_opt_num
=
10
def
format_cot_example
(
example
,
including_answer
=
True
):
prompt
=
f
"
{
lang_dict
[
0
]
}
\n
"
question
=
example
[
"question"
]
prompt
+=
question
+
"
\n
"
prompt
+=
f
"
{
lang_dict
[
1
]
}
\n
"
for
i
in
range
(
max_opt_num
):
opt
=
example
[
f
"option_
{
i
}
"
]
if
opt
is
not
None
:
prompt
+=
"{}. {}
\n
"
.
format
(
choices
[
i
],
opt
)
if
including_answer
:
cot_content
=
example
[
"cot_content"
].
replace
(
lang_dict
[
4
],
lang_dict
[
2
])
prompt
+=
cot_content
+
"
\n\n
"
else
:
prompt
+=
lang_dict
[
2
]
return
prompt
doc_to_text
=
partial
(
format_cot_example
,
including_answer
=
False
)
fewshot_to_text
=
partial
(
format_cot_example
,
including_answer
=
True
)
def
process_docs
(
dataset
,
subject
):
return
dataset
.
filter
(
lambda
x
:
x
[
"category"
]
==
subject
)
process_biology
=
partial
(
process_docs
,
subject
=
"biology"
)
process_business
=
partial
(
process_docs
,
subject
=
"business"
)
process_chemistry
=
partial
(
process_docs
,
subject
=
"chemistry"
)
process_computer_science
=
partial
(
process_docs
,
subject
=
"computer science"
)
process_economics
=
partial
(
process_docs
,
subject
=
"economics"
)
process_engineering
=
partial
(
process_docs
,
subject
=
"engineering"
)
process_health
=
partial
(
process_docs
,
subject
=
"health"
)
process_history
=
partial
(
process_docs
,
subject
=
"history"
)
process_law
=
partial
(
process_docs
,
subject
=
"law"
)
process_math
=
partial
(
process_docs
,
subject
=
"math"
)
process_other
=
partial
(
process_docs
,
subject
=
"other"
)
process_philosophy
=
partial
(
process_docs
,
subject
=
"philosophy"
)
process_physics
=
partial
(
process_docs
,
subject
=
"physics"
)
process_psychology
=
partial
(
process_docs
,
subject
=
"psychology"
)
lm_eval/tasks/mmlu_prox/vi/_mmlu_prox_lite_vi.yaml
0 → 100644
View file @
0b45cc71
group
:
mmlu_prox_lite_vi
task
:
-
mmlu_prox_lite_vi_biology
-
mmlu_prox_lite_vi_business
-
mmlu_prox_lite_vi_chemistry
-
mmlu_prox_lite_vi_computer_science
-
mmlu_prox_lite_vi_economics
-
mmlu_prox_lite_vi_engineering
-
mmlu_prox_lite_vi_health
-
mmlu_prox_lite_vi_history
-
mmlu_prox_lite_vi_law
-
mmlu_prox_lite_vi_math
-
mmlu_prox_lite_vi_other
-
mmlu_prox_lite_vi_philosophy
-
mmlu_prox_lite_vi_physics
-
mmlu_prox_lite_vi_psychology
aggregate_metric_list
:
-
aggregation
:
mean
metric
:
exact_match
weight_by_size
:
true
filter_list
:
custom-extract
metadata
:
version
:
0.0
lm_eval/tasks/mmlu_prox/vi/_mmlu_prox_vi.yaml
0 → 100644
View file @
0b45cc71
group
:
mmlu_prox_vi
task
:
-
mmlu_prox_vi_biology
-
mmlu_prox_vi_business
-
mmlu_prox_vi_chemistry
-
mmlu_prox_vi_computer_science
-
mmlu_prox_vi_economics
-
mmlu_prox_vi_engineering
-
mmlu_prox_vi_health
-
mmlu_prox_vi_history
-
mmlu_prox_vi_law
-
mmlu_prox_vi_math
-
mmlu_prox_vi_other
-
mmlu_prox_vi_philosophy
-
mmlu_prox_vi_physics
-
mmlu_prox_vi_psychology
aggregate_metric_list
:
-
aggregation
:
mean
metric
:
exact_match
weight_by_size
:
true
filter_list
:
custom-extract
metadata
:
version
:
0.0
lm_eval/tasks/mmlu_prox/vi/_vi_lite_template_yaml
0 → 100644
View file @
0b45cc71
dataset_path: li-lab/MMLU-ProX-Lite
dataset_name: vi
test_split: test
fewshot_split: validation
fewshot_config:
sampler: first_n
doc_to_text: !function utils.fewshot_to_text
doc_to_target: ""
output_type: generate_until
doc_to_text: !function utils.doc_to_text
doc_to_target: answer
filter_list:
- name: "custom-extract"
filter:
- function: "regex"
regex_pattern: 'Câu trả lời là \(?([ABCDEFGHIJ])\)?'
- function: "take_first"
generation_kwargs:
until:
- "</s>"
- "Q:"
- "Câu hỏi:"
- "<|im_end|>"
do_sample: false
temperature: 0.0
max_gen_toks: 2048
num_fewshot: 5
metric_list:
- metric: exact_match
aggregation: mean
higher_is_better: true
ignore_case: true
ignore_punctuation: true
metadata:
version: 0.0
lm_eval/tasks/mmlu_prox/vi/_vi_template_yaml
0 → 100644
View file @
0b45cc71
dataset_path: li-lab/MMLU-ProX
dataset_name: vi
test_split: test
fewshot_split: validation
fewshot_config:
sampler: first_n
doc_to_text: !function utils.fewshot_to_text
doc_to_target: ""
output_type: generate_until
doc_to_text: !function utils.doc_to_text
doc_to_target: answer
filter_list:
- name: "custom-extract"
filter:
- function: "regex"
regex_pattern: 'Câu trả lời là \(?([ABCDEFGHIJ])\)?'
- function: "take_first"
generation_kwargs:
until:
- "</s>"
- "Q:"
- "Câu hỏi:"
- "<|im_end|>"
do_sample: false
temperature: 0.0
max_gen_toks: 2048
num_fewshot: 5
metric_list:
- metric: exact_match
aggregation: mean
higher_is_better: true
ignore_case: true
ignore_punctuation: true
metadata:
version: 0.0
lm_eval/tasks/mmlu_prox/vi/mmlu_prox_lite_vi_biology.yaml
0 → 100644
View file @
0b45cc71
description
:
'
Dưới
đây
là
câu
hỏi
trắc
nghiệm
về
Sinh
học
(kèm
đáp
án).
Vui
lòng
suy
nghĩ
từng
bước,
sau
đó
kết
thúc
câu
trả
lời
của
bạn
bằng
"Câu
trả
lời
là
(X)",
trong
đó
X
là
chữ
cái
của
lựa
chọn
đúng.
'
include
:
_vi_lite_template_yaml
task
:
mmlu_prox_lite_vi_biology
task_alias
:
biology
process_docs
:
!function
utils.process_biology
lm_eval/tasks/mmlu_prox/vi/mmlu_prox_lite_vi_business.yaml
0 → 100644
View file @
0b45cc71
description
:
'
Dưới
đây
là
câu
hỏi
trắc
nghiệm
về
Kinh
doanh
(kèm
đáp
án).
Vui
lòng
suy
nghĩ
từng
bước,
sau
đó
kết
thúc
câu
trả
lời
của
bạn
bằng
"Câu
trả
lời
là
(X)",
trong
đó
X
là
chữ
cái
của
lựa
chọn
đúng.
'
include
:
_vi_lite_template_yaml
task
:
mmlu_prox_lite_vi_business
task_alias
:
business
process_docs
:
!function
utils.process_business
lm_eval/tasks/mmlu_prox/vi/mmlu_prox_lite_vi_chemistry.yaml
0 → 100644
View file @
0b45cc71
description
:
'
Dưới
đây
là
câu
hỏi
trắc
nghiệm
về
Hóa
học
(kèm
đáp
án).
Vui
lòng
suy
nghĩ
từng
bước,
sau
đó
kết
thúc
câu
trả
lời
của
bạn
bằng
"Câu
trả
lời
là
(X)",
trong
đó
X
là
chữ
cái
của
lựa
chọn
đúng.
'
include
:
_vi_lite_template_yaml
task
:
mmlu_prox_lite_vi_chemistry
task_alias
:
chemistry
process_docs
:
!function
utils.process_chemistry
Prev
1
…
26
27
28
29
30
31
32
33
34
…
38
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment