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
6a534600
Commit
6a534600
authored
Feb 13, 2021
by
thefazzer
Browse files
Merge remote-tracking branch 'origin/fazz/refactor-task-coqa' into fazz/refactor-task-coqa
parents
fee14a6d
f9750990
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
lm_eval/tasks/coqa.py
lm_eval/tasks/coqa.py
+2
-2
No files found.
lm_eval/tasks/coqa.py
View file @
6a534600
...
@@ -51,7 +51,7 @@ class CoQA(Task):
...
@@ -51,7 +51,7 @@ class CoQA(Task):
doc_text
=
doc
[
"story"
]
+
'
\n\n
'
doc_text
=
doc
[
"story"
]
+
'
\n\n
'
for
(
q
,
a
)
in
zip_longest
(
doc
[
"questions"
],
doc
[
"answers"
][:
-
1
]):
# omit target answer ai
for
(
q
,
a
)
in
zip_longest
(
doc
[
"questions"
],
doc
[
"answers"
][:
-
1
]):
# omit target answer ai
question
=
f
"Q:
{
q
[
'input_text'
]
}
"
+
'
\n\n
'
question
=
f
"Q:
{
q
[
'input_text'
]
}
"
+
'
\n\n
'
answer
=
f
"A:
{
a
[
'input_text'
]
}
"
+
'
\n\n
'
if
a
is
not
None
else
"A:
"
answer
=
f
"A:
{
a
[
'input_text'
]
}
"
+
'
\n\n
'
if
a
is
not
None
else
"A:"
doc_text
+=
question
+
answer
doc_text
+=
question
+
answer
print
(
doc_text
)
print
(
doc_text
)
return
doc_text
return
doc_text
...
...
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