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
155aeee9
"...resnet50_tensorflow.git" did not exist on "7c2ff1afc4423266223bcd50cba0ed55aca826c8"
Commit
155aeee9
authored
Feb 10, 2021
by
Jon Tow
Browse files
Rename list of loglikelihoods for consistency
parent
43e274f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
lm_eval/tasks/winogrande.py
lm_eval/tasks/winogrande.py
+3
-3
lm_eval/tasks/wsc273.py
lm_eval/tasks/wsc273.py
+3
-3
No files found.
lm_eval/tasks/winogrande.py
View file @
155aeee9
...
@@ -59,12 +59,12 @@ class Winogrande(HFTask):
...
@@ -59,12 +59,12 @@ class Winogrande(HFTask):
part of the document for `doc`.
part of the document for `doc`.
"""
"""
target
=
self
.
partial_target
(
doc
)
target
=
self
.
partial_target
(
doc
)
ll
=
[]
ll
s
=
[]
for
option
in
[
doc
[
"option1"
],
doc
[
"option2"
]]:
for
option
in
[
doc
[
"option1"
],
doc
[
"option2"
]]:
partial_ctx
=
self
.
partial_context
(
doc
,
option
)
partial_ctx
=
self
.
partial_context
(
doc
,
option
)
full_ctx
=
self
.
append_context
(
ctx
,
partial_ctx
)
full_ctx
=
self
.
append_context
(
ctx
,
partial_ctx
)
ll
.
append
(
rf
.
loglikelihood
(
full_ctx
,
target
)[
0
])
ll
s
.
append
(
rf
.
loglikelihood
(
full_ctx
,
target
)[
0
])
return
ll
return
ll
s
@
classmethod
@
classmethod
def
append_context
(
cls
,
ctx
,
partial_ctx
):
def
append_context
(
cls
,
ctx
,
partial_ctx
):
...
...
lm_eval/tasks/wsc273.py
View file @
155aeee9
...
@@ -90,12 +90,12 @@ class WinogradSchemaChallenge273(HFTask):
...
@@ -90,12 +90,12 @@ class WinogradSchemaChallenge273(HFTask):
part of the document for `doc`.
part of the document for `doc`.
"""
"""
target
=
self
.
partial_target
(
doc
)
target
=
self
.
partial_target
(
doc
)
ll
=
[]
ll
s
=
[]
for
option
in
doc
[
"options"
]:
for
option
in
doc
[
"options"
]:
partial_ctx
=
self
.
partial_context
(
doc
,
option
)
partial_ctx
=
self
.
partial_context
(
doc
,
option
)
full_ctx
=
self
.
append_context
(
ctx
,
partial_ctx
)
full_ctx
=
self
.
append_context
(
ctx
,
partial_ctx
)
ll
.
append
(
rf
.
loglikelihood
(
full_ctx
,
target
)[
0
])
ll
s
.
append
(
rf
.
loglikelihood
(
full_ctx
,
target
)[
0
])
return
ll
return
ll
s
@
classmethod
@
classmethod
def
append_context
(
cls
,
ctx
,
partial_ctx
):
def
append_context
(
cls
,
ctx
,
partial_ctx
):
...
...
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