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
4eecbabb
Commit
4eecbabb
authored
Sep 16, 2024
by
Baber
Browse files
Merge branch 'main' into prefill
parents
dac8b534
fb963f0f
Changes
465
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
394 additions
and
0 deletions
+394
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_arc_easy_light/arabic_leaderboard_arabic_mt_arc_easy_light.yaml
...sy_light/arabic_leaderboard_arabic_mt_arc_easy_light.yaml
+13
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_arc_easy_light/arabic_mt_arc_easy_light.yaml
...rd_arabic_mt_arc_easy_light/arabic_mt_arc_easy_light.yaml
+23
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_arc_easy_light/utils.py
...ight/arabic_leaderboard_arabic_mt_arc_easy_light/utils.py
+23
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_boolq_light/arabic_leaderboard_arabic_mt_boolq_light.yaml
...boolq_light/arabic_leaderboard_arabic_mt_boolq_light.yaml
+13
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_boolq_light/arabic_mt_boolq_light.yaml
...derboard_arabic_mt_boolq_light/arabic_mt_boolq_light.yaml
+23
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_boolq_light/utils.py
...d_light/arabic_leaderboard_arabic_mt_boolq_light/utils.py
+24
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_copa_light/arabic_mt_copa_light.yaml
...eaderboard_arabic_mt_copa_light/arabic_mt_copa_light.yaml
+23
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_copa_light/arbic_leaderboard_arabic_mt_copa_light.yaml
...mt_copa_light/arbic_leaderboard_arabic_mt_copa_light.yaml
+13
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_copa_light/utils.py
...rd_light/arabic_leaderboard_arabic_mt_copa_light/utils.py
+19
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_hellaswag_light/arabic_leaderboard_arabic_mt_hellaswag_light.yaml
...g_light/arabic_leaderboard_arabic_mt_hellaswag_light.yaml
+13
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_hellaswag_light/arabic_mt_hellaswag_light.yaml
..._arabic_mt_hellaswag_light/arabic_mt_hellaswag_light.yaml
+23
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_hellaswag_light/utils.py
...ght/arabic_leaderboard_arabic_mt_hellaswag_light/utils.py
+30
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_mmlu_light/arabic_leaderboard_arabic_mt_mmlu_light.yaml
...t_mmlu_light/arabic_leaderboard_arabic_mt_mmlu_light.yaml
+13
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_mmlu_light/arabic_mt_mmlu_light.yaml
...eaderboard_arabic_mt_mmlu_light/arabic_mt_mmlu_light.yaml
+23
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_mmlu_light/utils.py
...rd_light/arabic_leaderboard_arabic_mt_mmlu_light/utils.py
+23
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_openbook_qa_light/arabic_leaderboard_arabic_mt_openbook_qa_light.yaml
...light/arabic_leaderboard_arabic_mt_openbook_qa_light.yaml
+13
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_openbook_qa_light/arabic_mt_openbook_qa_light.yaml
...bic_mt_openbook_qa_light/arabic_mt_openbook_qa_light.yaml
+23
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_openbook_qa_light/utils.py
...t/arabic_leaderboard_arabic_mt_openbook_qa_light/utils.py
+23
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_piqa_light/arabic_leaderboard_arabic_mt_piqa_light.yaml
...t_piqa_light/arabic_leaderboard_arabic_mt_piqa_light.yaml
+13
-0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_piqa_light/arabic_mt_piqa_light.yaml
...eaderboard_arabic_mt_piqa_light/arabic_mt_piqa_light.yaml
+23
-0
No files found.
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_arc_easy_light/arabic_leaderboard_arabic_mt_arc_easy_light.yaml
0 → 100644
View file @
4eecbabb
group
:
arabic_leaderboard_arabic_mt_arc_easy_light
task
:
-
arabic_mt_arc_easy_light
aggregate_metric_list
:
-
metric
:
acc
aggregation
:
mean
weight_by_size
:
true
-
metric
:
acc_norm
aggregation
:
mean
weight_by_size
:
true
metadata
:
version
:
1.0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_arc_easy_light/arabic_mt_arc_easy_light.yaml
0 → 100644
View file @
4eecbabb
task
:
arabic_mt_arc_easy_light
dataset_path
:
arcee-globe/AlGhafa-Arabic-LLM-Benchmark-Translated-10percent
dataset_name
:
arc_easy_ar
output_type
:
multiple_choice
training_split
:
null
validation_split
:
validation
test_split
:
test
process_docs
:
!function
utils.process_docs
doc_to_text
:
"
{{query}}"
doc_to_target
:
"
{{gold}}"
doc_to_choice
:
"
choices"
fewshot_split
:
validation
fewshot_config
:
sampler
:
first_n
metric_list
:
-
metric
:
acc
aggregation
:
mean
higher_is_better
:
true
-
metric
:
acc_norm
aggregation
:
mean
higher_is_better
:
true
metadata
:
version
:
1.0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_arc_easy_light/utils.py
0 → 100644
View file @
4eecbabb
import
datasets
import
numpy
as
np
def
process_docs
(
dataset
:
datasets
.
Dataset
):
def
_process_doc
(
doc
):
question
=
doc
[
"query"
]
answer_index
=
int
(
doc
[
"label"
])
# Dynamically determining the choices by excluding '__few_shots', 'query' and 'label'
choices_keys
=
[
key
for
key
in
doc
.
keys
()
if
key
not
in
[
"query"
,
"label"
,
"__few_shots"
]
]
choices
=
[
doc
[
key
]
for
key
in
choices_keys
]
instruction
=
"الأسئلة التالية هي أسئلة متعددة الإختيارات مع الجواب الصحيح
\n\n
"
query
=
f
"
{
instruction
}
السؤال:
{
question
}
\n
"
for
index
,
choice
in
enumerate
(
choices
):
query
+=
f
"
{
index
}
)
{
choice
}
\n
"
query
+=
"الإجابة:"
return
{
"query"
:
query
,
"choices"
:
choices
,
"gold"
:
answer_index
}
return
dataset
.
map
(
_process_doc
)
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_boolq_light/arabic_leaderboard_arabic_mt_boolq_light.yaml
0 → 100644
View file @
4eecbabb
group
:
arabic_leaderboard_arabic_mt_boolq_light
task
:
-
arabic_mt_boolq_light
aggregate_metric_list
:
-
metric
:
acc
aggregation
:
mean
weight_by_size
:
true
-
metric
:
acc_norm
aggregation
:
mean
weight_by_size
:
true
metadata
:
version
:
1.0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_boolq_light/arabic_mt_boolq_light.yaml
0 → 100644
View file @
4eecbabb
task
:
arabic_mt_boolq_light
dataset_path
:
arcee-globe/AlGhafa-Arabic-LLM-Benchmark-Translated-10percent
dataset_name
:
boolq_ar
output_type
:
multiple_choice
training_split
:
null
validation_split
:
validation
test_split
:
test
process_docs
:
!function
utils.process_docs
doc_to_text
:
"
{{query}}"
doc_to_target
:
"
{{gold}}"
doc_to_choice
:
"
choices"
fewshot_split
:
validation
fewshot_config
:
sampler
:
first_n
metric_list
:
-
metric
:
acc
aggregation
:
mean
higher_is_better
:
true
-
metric
:
acc_norm
aggregation
:
mean
higher_is_better
:
true
metadata
:
version
:
1.0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_boolq_light/utils.py
0 → 100644
View file @
4eecbabb
import
datasets
import
numpy
as
np
def
process_docs
(
dataset
:
datasets
.
Dataset
):
def
_process_doc
(
doc
):
question
=
doc
[
"question"
]
passage
=
doc
[
"passage"
]
instruction
=
"بناء على المقطع التالي، أجب عن السؤال ب نعم أو لا"
query
=
f
"""
{
instruction
}
المقطع :
{
passage
}
السؤال:
{
question
}
الإجابة:
"""
return
{
"query"
:
query
,
"choices"
:
[
"نعم"
,
"لا"
],
"gold"
:
0
if
doc
[
"answer"
]
else
1
,
}
return
dataset
.
map
(
_process_doc
)
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_copa_light/arabic_mt_copa_light.yaml
0 → 100644
View file @
4eecbabb
task
:
arabic_mt_copa_light
dataset_path
:
arcee-globe/AlGhafa-Arabic-LLM-Benchmark-Translated-10percent
dataset_name
:
copa_ext_ar
output_type
:
multiple_choice
training_split
:
null
validation_split
:
validation
test_split
:
test
process_docs
:
!function
utils.process_docs
doc_to_text
:
"
{{query}}"
doc_to_target
:
"
{{gold}}"
doc_to_choice
:
"
choices"
fewshot_split
:
validation
fewshot_config
:
sampler
:
first_n
metric_list
:
-
metric
:
acc
aggregation
:
mean
higher_is_better
:
true
-
metric
:
acc_norm
aggregation
:
mean
higher_is_better
:
true
metadata
:
version
:
1.0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_copa_light/arbic_leaderboard_arabic_mt_copa_light.yaml
0 → 100644
View file @
4eecbabb
group
:
arabic_leaderboard_arabic_mt_copa_light
task
:
-
arabic_mt_copa_light
aggregate_metric_list
:
-
metric
:
acc
aggregation
:
mean
weight_by_size
:
true
-
metric
:
acc_norm
aggregation
:
mean
weight_by_size
:
true
metadata
:
version
:
1.0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_copa_light/utils.py
0 → 100644
View file @
4eecbabb
import
datasets
import
numpy
as
np
def
process_docs
(
dataset
:
datasets
.
Dataset
):
def
_process_doc
(
doc
):
premise
=
doc
[
"premise"
]
choices
=
[
doc
[
"choice1"
],
doc
[
"choice2"
]]
question_map
=
{
"cause"
:
"لأن"
,
"effect"
:
"لذلك"
}
question
=
question_map
[
doc
[
"question"
]]
answer
=
doc
[
"label"
]
query
=
"{}، {} :
\n
0) {}
\n
1) {}
\n
الإجابة:"
.
format
(
premise
,
question
,
choices
[
0
],
choices
[
1
]
)
return
{
"query"
:
query
,
"choices"
:
choices
,
"gold"
:
answer
}
return
dataset
.
map
(
_process_doc
)
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_hellaswag_light/arabic_leaderboard_arabic_mt_hellaswag_light.yaml
0 → 100644
View file @
4eecbabb
group
:
arabic_leaderboard_arabic_mt_hellaswag_light
task
:
-
arabic_mt_hellaswag_light
aggregate_metric_list
:
-
metric
:
acc
aggregation
:
mean
weight_by_size
:
true
-
metric
:
acc_norm
aggregation
:
mean
weight_by_size
:
true
metadata
:
version
:
1.0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_hellaswag_light/arabic_mt_hellaswag_light.yaml
0 → 100644
View file @
4eecbabb
task
:
arabic_mt_hellaswag_light
dataset_path
:
arcee-globe/AlGhafa-Arabic-LLM-Benchmark-Translated-10percent
dataset_name
:
hellaswag_okapi_ar
output_type
:
multiple_choice
training_split
:
null
validation_split
:
validation
test_split
:
test
process_docs
:
!function
utils.process_docs
doc_to_text
:
"
{{query}}"
doc_to_target
:
"
{{gold}}"
doc_to_choice
:
"
choices"
fewshot_split
:
validation
fewshot_config
:
sampler
:
first_n
metric_list
:
-
metric
:
acc
aggregation
:
mean
higher_is_better
:
true
-
metric
:
acc_norm
aggregation
:
mean
higher_is_better
:
true
metadata
:
version
:
1.0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_hellaswag_light/utils.py
0 → 100644
View file @
4eecbabb
import
re
import
datasets
import
numpy
as
np
def
process_docs
(
dataset
:
datasets
.
Dataset
):
def
_process_doc
(
doc
):
ctx
=
re
.
sub
(
r
"\[.*?\]"
,
""
,
doc
[
"ctx"
])
# Remove latin words within brackets
endings
=
[
re
.
sub
(
r
"\[.*?\]"
,
""
,
e
)
for
e
in
eval
(
doc
[
"endings"
])
]
# endings is a string representation of a list
answer_index
=
doc
[
"label"
]
instruction
=
(
"بناء على السياق التالي، اختر النهاية الصحيحة من الاقتراحات التالية"
)
query
=
f
"""
{
instruction
}
السياق:
{
ctx
}
الاقتراحات:
"""
for
i
,
ending
in
enumerate
(
endings
):
query
+=
f
"
{
i
}
)
{
ending
}
\n
"
query
+=
"الإجابة:"
return
{
"query"
:
query
,
"choices"
:
endings
,
"gold"
:
answer_index
}
return
dataset
.
map
(
_process_doc
)
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_mmlu_light/arabic_leaderboard_arabic_mt_mmlu_light.yaml
0 → 100644
View file @
4eecbabb
group
:
arabic_leaderboard_arabic_mt_mmlu_light
task
:
-
arabic_mt_mmlu_light
aggregate_metric_list
:
-
metric
:
acc
aggregation
:
mean
weight_by_size
:
true
-
metric
:
acc_norm
aggregation
:
mean
weight_by_size
:
true
metadata
:
version
:
1.0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_mmlu_light/arabic_mt_mmlu_light.yaml
0 → 100644
View file @
4eecbabb
task
:
arabic_mt_mmlu_light
dataset_path
:
arcee-globe/AlGhafa-Arabic-LLM-Benchmark-Translated-10percent
dataset_name
:
mmlu_okapi_ar
output_type
:
multiple_choice
training_split
:
null
validation_split
:
validation
test_split
:
test
process_docs
:
!function
utils.process_docs
doc_to_text
:
"
{{query}}"
doc_to_target
:
"
{{gold}}"
doc_to_choice
:
"
choices"
fewshot_split
:
validation
fewshot_config
:
sampler
:
first_n
metric_list
:
-
metric
:
acc
aggregation
:
mean
higher_is_better
:
true
-
metric
:
acc_norm
aggregation
:
mean
higher_is_better
:
true
metadata
:
version
:
1.0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_mmlu_light/utils.py
0 → 100644
View file @
4eecbabb
import
datasets
import
numpy
as
np
def
process_docs
(
dataset
:
datasets
.
Dataset
):
def
_process_doc
(
doc
):
question
=
doc
[
"query"
]
answer_index
=
int
(
doc
[
"label"
])
# Dynamically determining the choices by excluding '__few_shots', 'query' and 'label'
choices_keys
=
[
key
for
key
in
doc
.
keys
()
if
key
not
in
[
"query"
,
"label"
,
"__few_shots"
]
]
choices
=
[
doc
[
key
]
for
key
in
choices_keys
]
instruction
=
"الأسئلة التالية هي أسئلة متعددة الإختيارات مع الجواب الصحيح
\n\n
"
query
=
f
"
{
instruction
}
السؤال:
{
question
}
\n
"
for
index
,
choice
in
enumerate
(
choices
):
query
+=
f
"
{
index
}
)
{
choice
}
\n
"
query
+=
"الإجابة:"
return
{
"query"
:
query
,
"choices"
:
choices
,
"gold"
:
answer_index
}
return
dataset
.
map
(
_process_doc
)
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_openbook_qa_light/arabic_leaderboard_arabic_mt_openbook_qa_light.yaml
0 → 100644
View file @
4eecbabb
group
:
arabic_leaderboard_arabic_mt_openbook_qa_light
task
:
-
arabic_mt_openbook_qa_light
aggregate_metric_list
:
-
metric
:
acc
aggregation
:
mean
weight_by_size
:
true
-
metric
:
acc_norm
aggregation
:
mean
weight_by_size
:
true
metadata
:
version
:
1.0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_openbook_qa_light/arabic_mt_openbook_qa_light.yaml
0 → 100644
View file @
4eecbabb
task
:
arabic_mt_openbook_qa_light
dataset_path
:
arcee-globe/AlGhafa-Arabic-LLM-Benchmark-Translated-10percent
dataset_name
:
openbook_qa_ext_ar
output_type
:
multiple_choice
training_split
:
null
validation_split
:
validation
test_split
:
test
process_docs
:
!function
utils.process_docs
doc_to_text
:
"
{{query}}"
doc_to_target
:
"
{{gold}}"
doc_to_choice
:
"
choices"
fewshot_split
:
validation
fewshot_config
:
sampler
:
first_n
metric_list
:
-
metric
:
acc
aggregation
:
mean
higher_is_better
:
true
-
metric
:
acc_norm
aggregation
:
mean
higher_is_better
:
true
metadata
:
version
:
1.0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_openbook_qa_light/utils.py
0 → 100644
View file @
4eecbabb
import
datasets
import
numpy
as
np
def
process_docs
(
dataset
:
datasets
.
Dataset
):
def
_process_doc
(
doc
):
question
=
doc
[
"query"
]
answer_index
=
int
(
doc
[
"label"
])
# Dynamically determining the choices by excluding '__few_shots', 'query' and 'label'
choices_keys
=
[
key
for
key
in
doc
.
keys
()
if
key
not
in
[
"query"
,
"label"
,
"__few_shots"
]
]
choices
=
[
doc
[
key
]
for
key
in
choices_keys
]
instruction
=
"الأسئلة التالية هي أسئلة متعددة الإختيارات مع الجواب الصحيح
\n\n
"
query
=
f
"
{
instruction
}
السؤال:
{
question
}
\n
"
for
index
,
choice
in
enumerate
(
choices
):
query
+=
f
"
{
index
}
)
{
choice
}
\n
"
query
+=
"الإجابة:"
return
{
"query"
:
query
,
"choices"
:
choices
,
"gold"
:
answer_index
}
return
dataset
.
map
(
_process_doc
)
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_piqa_light/arabic_leaderboard_arabic_mt_piqa_light.yaml
0 → 100644
View file @
4eecbabb
group
:
arabic_leaderboard_arabic_mt_piqa_light
task
:
-
arabic_mt_piqa_light
aggregate_metric_list
:
-
metric
:
acc
aggregation
:
mean
weight_by_size
:
true
-
metric
:
acc_norm
aggregation
:
mean
weight_by_size
:
true
metadata
:
version
:
1.0
lm_eval/tasks/arabic_leaderboard_light/arabic_leaderboard_arabic_mt_piqa_light/arabic_mt_piqa_light.yaml
0 → 100644
View file @
4eecbabb
task
:
arabic_mt_piqa_light
dataset_path
:
arcee-globe/AlGhafa-Arabic-LLM-Benchmark-Translated-10percent
dataset_name
:
piqa_ar
output_type
:
multiple_choice
training_split
:
null
validation_split
:
validation
test_split
:
test
process_docs
:
!function
utils.process_docs
doc_to_text
:
"
{{query}}"
doc_to_target
:
"
{{gold}}"
doc_to_choice
:
"
choices"
fewshot_split
:
validation
fewshot_config
:
sampler
:
first_n
metric_list
:
-
metric
:
acc
aggregation
:
mean
higher_is_better
:
true
-
metric
:
acc_norm
aggregation
:
mean
higher_is_better
:
true
metadata
:
version
:
1.0
Prev
1
…
10
11
12
13
14
15
16
17
18
…
24
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