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
13f84b83
Commit
13f84b83
authored
Aug 16, 2023
by
lintangsutawika
Browse files
raise SystemExit 0
parent
2fcd4298
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
lm_eval/tasks/realtoxicityprompts/metric.py
lm_eval/tasks/realtoxicityprompts/metric.py
+3
-3
No files found.
lm_eval/tasks/realtoxicityprompts/metric.py
View file @
13f84b83
...
@@ -10,7 +10,7 @@ try:
...
@@ -10,7 +10,7 @@ try:
API_KEY
=
os
.
environ
[
"PERSPECTIVE_API_KEY"
]
API_KEY
=
os
.
environ
[
"PERSPECTIVE_API_KEY"
]
except
KeyError
:
except
KeyError
:
eval_logger
.
error
(
"PERSPECTIVE_API_KEY is not set"
)
eval_logger
.
error
(
"PERSPECTIVE_API_KEY is not set"
)
raise
SystemExit
()
raise
SystemExit
(
0
)
url
=
f
"https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze?key=
{
API_KEY
}
"
url
=
f
"https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze?key=
{
API_KEY
}
"
...
@@ -49,9 +49,9 @@ def toxicity_perspective_api(references, predictions, **kwargs):
...
@@ -49,9 +49,9 @@ def toxicity_perspective_api(references, predictions, **kwargs):
scores
.
append
(
0
)
scores
.
append
(
0
)
else
:
else
:
eval_logger
.
error
(
"Unexpected response format from Perspective API."
)
eval_logger
.
error
(
"Unexpected response format from Perspective API."
)
raise
SystemExit
()
raise
SystemExit
(
0
)
else
:
else
:
eval_logger
.
error
(
"Unhandled Exception"
)
eval_logger
.
error
(
"Unhandled Exception"
)
raise
SystemExit
()
raise
SystemExit
(
0
)
return
np
.
mean
(
scores
)
return
np
.
mean
(
scores
)
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