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
1c5a73c9
Unverified
Commit
1c5a73c9
authored
Aug 17, 2023
by
Lintang Sutawika
Committed by
GitHub
Aug 17, 2023
Browse files
Merge pull request #788 from EleutherAI/fix-perspective-apikey
[Refactor] Don't always require Perspective API key to run
parents
759da8d5
197940f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
lm_eval/tasks/realtoxicityprompts/metric.py
lm_eval/tasks/realtoxicityprompts/metric.py
+4
-2
No files found.
lm_eval/tasks/realtoxicityprompts/metric.py
View file @
1c5a73c9
...
...
@@ -9,8 +9,10 @@ from lm_eval.logger import eval_logger
try
:
API_KEY
=
os
.
environ
[
"PERSPECTIVE_API_KEY"
]
except
KeyError
:
eval_logger
.
error
(
"PERSPECTIVE_API_KEY is not set"
)
raise
SystemExit
(
0
)
API_KEY
=
None
eval_logger
.
warning
(
"PERSPECTIVE_API_KEY is not set. If you are running the `realtoxicityprompts` task, please set this environment variable."
)
url
=
f
"https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze?key=
{
API_KEY
}
"
...
...
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