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
dc648d84
Unverified
Commit
dc648d84
authored
Jun 12, 2021
by
Leo Gao
Committed by
GitHub
Jun 12, 2021
Browse files
Merge pull request #195 from EleutherAI/sdtblck-patch-1
Change generate until sequence in coqa to be \nQ:
parents
7069583b
41b0ae22
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
+5
-3
lm_eval/tasks/coqa.py
lm_eval/tasks/coqa.py
+3
-3
tests/testdata/coqa-v1-greedy_until
tests/testdata/coqa-v1-greedy_until
+1
-0
tests/testdata/coqa-v1-res.json
tests/testdata/coqa-v1-res.json
+1
-0
No files found.
lm_eval/tasks/coqa.py
View file @
dc648d84
...
...
@@ -8,7 +8,7 @@ from best_download import download_file
class
CoQA
(
Task
):
VERSION
=
0
VERSION
=
1
def
download
(
self
):
coqa_train_filepath
=
'data/coqa/coqa-train-v1.0.json'
...
...
@@ -115,7 +115,7 @@ class CoQA(Task):
language description, as well as the few shot examples, and the question
part of the document for `doc`.
"""
cont_request
=
rf
.
greedy_until
(
ctx
,
[
'
\n
'
])
cont_request
=
rf
.
greedy_until
(
ctx
,
[
'
\n
Q:
'
])
return
cont_request
def
process_results
(
self
,
doc
,
results
):
...
...
@@ -130,7 +130,7 @@ class CoQA(Task):
"""
turn_id
=
len
(
doc
[
"questions"
])
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
)
...
...
tests/testdata/coqa-v1-greedy_until
0 → 100644
View file @
dc648d84
57581470b921435d40da97872bb1cfda6ecf963ccc4b0240a3b04e3fea8c8e3a
\ No newline at end of file
tests/testdata/coqa-v1-res.json
0 → 100644
View file @
dc648d84
{
"results"
:
{
"coqa"
:
{
"em"
:
0.0
,
"em_stderr"
:
0.0
,
"f1"
:
0.0
,
"f1_stderr"
:
0.0
}},
"versions"
:
{
"coqa"
:
1
}}
\ No newline at end of file
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