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
da77b216
Commit
da77b216
authored
Aug 17, 2023
by
baberabb
Browse files
added indices equality check
parent
72bb97ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
tests/models/test_huggingface.py
tests/models/test_huggingface.py
+5
-0
No files found.
tests/models/test_huggingface.py
View file @
da77b216
...
@@ -91,6 +91,11 @@ class Test_HFLM:
...
@@ -91,6 +91,11 @@ class Test_HFLM:
res
=
self
.
LM
.
loglikelihood
(
self
.
MULTIPLE_CH
)
res
=
self
.
LM
.
loglikelihood
(
self
.
MULTIPLE_CH
)
_RES
,
_res
=
[
r
[
0
]
for
r
in
self
.
MULTIPLE_CH_RES
],
[
r
[
0
]
for
r
in
res
]
_RES
,
_res
=
[
r
[
0
]
for
r
in
self
.
MULTIPLE_CH_RES
],
[
r
[
0
]
for
r
in
res
]
assert
np
.
allclose
(
_res
,
_RES
,
atol
=
1e-2
)
assert
np
.
allclose
(
_res
,
_RES
,
atol
=
1e-2
)
# check indices for Multiple Choice
argmax_RES
,
argmax_res
=
np
.
argmax
(
np
.
array
(
_RES
).
reshape
(
-
1
,
4
),
axis
=
1
),
np
.
argmax
(
np
.
array
(
_res
).
reshape
(
-
1
,
4
),
axis
=
1
)
assert
(
argmax_RES
==
argmax_res
).
all
()
def
test_greedy_until
(
self
)
->
None
:
def
test_greedy_until
(
self
)
->
None
:
res
=
self
.
LM
.
greedy_until
(
self
.
GREEDY_UNTIL
)
res
=
self
.
LM
.
greedy_until
(
self
.
GREEDY_UNTIL
)
...
...
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