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
7bc9b82b
Commit
7bc9b82b
authored
Dec 10, 2023
by
h-albert-lee
Browse files
bug fix (f-string)
parent
c64da8ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
lm_eval/tasks/kmmlu/utils.py
lm_eval/tasks/kmmlu/utils.py
+9
-6
No files found.
lm_eval/tasks/kmmlu/utils.py
View file @
7bc9b82b
...
...
@@ -2,12 +2,14 @@ import datasets
def
process_docs
(
dataset
:
datasets
.
Dataset
)
->
datasets
.
Dataset
:
def
_process_doc
(
doc
):
instruction
=
f
"""다음을 읽고 정답으로 알맞은 것을 고르시요.
### Context:
{
doc
[
"context"
]
}
### Question:
{
doc
[
"question"
]
}
### Options:
(1)
{
doc
[
'option#1'
]
}
\n
(2)
{
doc
[
"option#2"
]
}
\n
(3)
{
doc
[
"option#3"
]
}
\n
(4)
{
doc
[
'option#4'
]
}
}
### Answer: 주어진 문제의 정답은"""
instruction
=
(
f
"다음을 읽고 정답으로 알맞은 것을 고르시요.
\n
"
f
"### Context:
{
doc
[
'context'
]
}
\n
"
f
"### Question:
{
doc
[
'question'
]
}
\n
"
f
"### Options:
\n
"
f
"(1)
{
doc
[
'option#1'
]
}
\n
(2)
{
doc
[
'option#2'
]
}
\n
(3)
{
doc
[
'option#3'
]
}
\n
(4)
{
doc
[
'option#4'
]
}
\n
"
f
"### Answer: 주어진 문제의 정답은"
)
out_doc
=
{
"question"
:
instruction
,
"choices"
:
[
"(1)"
,
"(2)"
,
"(3)"
,
"(4)"
],
...
...
@@ -16,3 +18,4 @@ def process_docs(dataset: datasets.Dataset) -> datasets.Dataset:
return
out_doc
return
dataset
.
map
(
_process_doc
)
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