Commit 13f84b83 authored by lintangsutawika's avatar lintangsutawika
Browse files

raise SystemExit 0

parent 2fcd4298
......@@ -10,7 +10,7 @@ try:
API_KEY = os.environ["PERSPECTIVE_API_KEY"]
except KeyError:
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}"
......@@ -49,9 +49,9 @@ def toxicity_perspective_api(references, predictions, **kwargs):
scores.append(0)
else:
eval_logger.error("Unexpected response format from Perspective API.")
raise SystemExit()
raise SystemExit(0)
else:
eval_logger.error("Unhandled Exception")
raise SystemExit()
raise SystemExit(0)
return np.mean(scores)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment