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
f14571fb
Commit
f14571fb
authored
Jun 11, 2021
by
Leo Gao
Browse files
Actually do things correctly this time
parent
278863b5
Changes
1
Hide 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 @
f14571fb
...
@@ -115,7 +115,7 @@ class CoQA(Task):
...
@@ -115,7 +115,7 @@ class CoQA(Task):
language description, as well as the few shot examples, and the question
language description, as well as the few shot examples, and the question
part of the document for `doc`.
part of the document for `doc`.
"""
"""
cont_request
=
rf
.
greedy_until
(
ctx
,
[
'
\n
Q:'
])
.
strip
().
split
(
'
\n
'
)[
0
]
cont_request
=
rf
.
greedy_until
(
ctx
,
[
'
\n
Q:'
])
return
cont_request
return
cont_request
def
process_results
(
self
,
doc
,
results
):
def
process_results
(
self
,
doc
,
results
):
...
@@ -130,7 +130,7 @@ class CoQA(Task):
...
@@ -130,7 +130,7 @@ class CoQA(Task):
"""
"""
turn_id
=
len
(
doc
[
"questions"
])
turn_id
=
len
(
doc
[
"questions"
])
gold_list
=
self
.
get_answers
(
doc
,
turn_id
)
gold_list
=
self
.
get_answers
(
doc
,
turn_id
)
pred
=
results
[
0
]
pred
=
results
[
0
]
.
strip
().
split
(
'
\n
'
)[
0
]
scores
=
self
.
compute_scores
(
gold_list
,
pred
)
scores
=
self
.
compute_scores
(
gold_list
,
pred
)
...
...
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