Unverified Commit 1c5a73c9 authored by Lintang Sutawika's avatar Lintang Sutawika Committed by GitHub
Browse files

Merge pull request #788 from EleutherAI/fix-perspective-apikey

[Refactor] Don't always require Perspective API key to run 
parents 759da8d5 197940f7
......@@ -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}"
......
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