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
3d732e68
Unverified
Commit
3d732e68
authored
Aug 19, 2023
by
Hailey Schoelkopf
Committed by
GitHub
Aug 19, 2023
Browse files
Merge pull request #793 from baberabb/big-refactor_test1
[Big refactor] HF test fixup
parents
0cdd730e
21706139
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
.github/workflows/unit_tests.yml
.github/workflows/unit_tests.yml
+1
-1
tests/models/test_huggingface.py
tests/models/test_huggingface.py
+1
-1
No files found.
.github/workflows/unit_tests.yml
View file @
3d732e68
...
@@ -64,4 +64,4 @@ jobs:
...
@@ -64,4 +64,4 @@ jobs:
# pip install bleurt@https://github.com/google-research/bleurt/archive/b610120347ef22b494b6d69b4316e303f5932516.zip#egg=bleurt
# pip install bleurt@https://github.com/google-research/bleurt/archive/b610120347ef22b494b6d69b4316e303f5932516.zip#egg=bleurt
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
-
name
:
Test with pytest
-
name
:
Test with pytest
run
:
python -m pytest --showlocals -s -v -n=auto --ignore=tests/tests_master --ignore=tests/extra
run
:
python -m pytest --showlocals -s -v
v
-n=auto --ignore=tests/tests_master --ignore=tests/extra
tests/models/test_huggingface.py
View file @
3d732e68
...
@@ -91,7 +91,7 @@ class Test_HFLM:
...
@@ -91,7 +91,7 @@ class Test_HFLM:
res
=
self
.
LM
.
loglikelihood
(
self
.
MULTIPLE_CH
)
res
=
self
.
LM
.
loglikelihood
(
self
.
MULTIPLE_CH
)
_RES
,
_res
=
self
.
MULTIPLE_CH_RES
,
[
r
[
0
]
for
r
in
res
]
_RES
,
_res
=
self
.
MULTIPLE_CH_RES
,
[
r
[
0
]
for
r
in
res
]
# change atol in case of consistent failure
# change atol in case of consistent failure
assert
np
.
allclose
(
_res
,
_RES
)
assert
np
.
allclose
(
_res
,
_RES
,
atol
=
1e-4
)
# check indices for Multiple Choice
# check indices for Multiple Choice
argmax_RES
,
argmax_res
=
np
.
argmax
(
argmax_RES
,
argmax_res
=
np
.
argmax
(
np
.
array
(
_RES
).
reshape
(
-
1
,
4
),
axis
=
1
np
.
array
(
_RES
).
reshape
(
-
1
,
4
),
axis
=
1
...
...
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