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
50967725
Commit
50967725
authored
Dec 13, 2023
by
lintangsutawika
Browse files
fixed style
parent
4bff76d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
lm_eval/tasks/mmlu/alternative_worlds/mmlu_output_variation.yaml
.../tasks/mmlu/alternative_worlds/mmlu_output_variation.yaml
+1
-1
lm_eval/tasks/mmlu/alternative_worlds/styles.py
lm_eval/tasks/mmlu/alternative_worlds/styles.py
+4
-4
No files found.
lm_eval/tasks/mmlu/alternative_worlds/mmlu_output_variation.yaml
View file @
50967725
...
@@ -7,4 +7,4 @@ task:
...
@@ -7,4 +7,4 @@ task:
-
mmlu_alt_ov_05
-
mmlu_alt_ov_05
-
mmlu_alt_ov_06
-
mmlu_alt_ov_06
-
mmlu_alt_ov_07
-
mmlu_alt_ov_07
-
mmlu_alt_ov_08
-
mmlu_alt_ov_08
\ No newline at end of file
lm_eval/tasks/mmlu/alternative_worlds/styles.py
View file @
50967725
...
@@ -4,7 +4,7 @@ from functools import partial
...
@@ -4,7 +4,7 @@ from functools import partial
def
doc_to_text_base
(
alphabet
,
style
,
doc
):
def
doc_to_text_base
(
alphabet
,
style
,
doc
):
choices
=
doc
[
"choices"
]
[
"text"
]
choices
=
doc
[
"choices"
]
num
=
len
(
choices
)
num
=
len
(
choices
)
letter_list
=
[
style
.
format
(
letter
)
for
letter
in
alphabet
[
0
:
num
]]
letter_list
=
[
style
.
format
(
letter
)
for
letter
in
alphabet
[
0
:
num
]]
...
@@ -26,13 +26,13 @@ def doc_to_text_base(alphabet, style, doc):
...
@@ -26,13 +26,13 @@ def doc_to_text_base(alphabet, style, doc):
# Full continuation
# Full continuation
def
choice_A
(
doc
):
def
choice_A
(
doc
):
return
doc
[
"choices"
]
[
"text"
]
return
doc
[
"choices"
]
# Letters only
# Letters only
def
choice_B
(
alphabet
,
style
,
doc
):
def
choice_B
(
alphabet
,
style
,
doc
):
choices
=
doc
[
"choices"
]
[
"text"
]
choices
=
doc
[
"choices"
]
num
=
len
(
choices
)
num
=
len
(
choices
)
letter_list
=
[
style
.
format
(
letter
)
for
letter
in
alphabet
[
0
:
num
]]
letter_list
=
[
style
.
format
(
letter
)
for
letter
in
alphabet
[
0
:
num
]]
...
@@ -45,7 +45,7 @@ def choice_B(alphabet, style, doc):
...
@@ -45,7 +45,7 @@ def choice_B(alphabet, style, doc):
# Letters + Full continuation
# Letters + Full continuation
def
choice_C
(
alphabet
,
style
,
doc
):
def
choice_C
(
alphabet
,
style
,
doc
):
choices
=
doc
[
"choices"
]
[
"text"
]
choices
=
doc
[
"choices"
]
num
=
len
(
choices
)
num
=
len
(
choices
)
letter_list
=
[
style
.
format
(
letter
)
for
letter
in
alphabet
[
0
:
num
]]
letter_list
=
[
style
.
format
(
letter
)
for
letter
in
alphabet
[
0
:
num
]]
...
...
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