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
01b98d2d
Unverified
Commit
01b98d2d
authored
Dec 05, 2021
by
Leo Gao
Committed by
GitHub
Dec 05, 2021
Browse files
Update test_gpt3.py
parent
7c011370
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
tests/test_gpt3.py
tests/test_gpt3.py
+1
-0
No files found.
tests/test_gpt3.py
View file @
01b98d2d
...
...
@@ -76,6 +76,7 @@ def test_gpt3():
@
mock
.
patch
(
"lm_eval.models.gpt3.oa_completion"
,
new
=
mock_completion
)
def
test_gpt3_perplexity
():
if
"OPENAI_API_SECRET_KEY"
not
in
os
.
environ
:
os
.
environ
[
"OPENAI_API_SECRET_KEY"
]
=
""
gpt3
=
models
.
get_model
(
'gpt3'
).
create_from_arg_string
(
"engine=ada"
)
test_string
=
"We study empirical scaling laws for language model performance on the cross-entropy loss."
perplexity
=
gpt3
.
loglikelihood_rolling
([(
test_string
,)])[
0
]
...
...
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