From 61bb7ad3ffebfbfbefc7cd372a7e3d70405b3ab4 Mon Sep 17 00:00:00 2001 From: Niklas Muennighoff Date: Sat, 25 Nov 2023 14:33:43 -0800 Subject: [PATCH] Fix mssg check --- src/alpaca_eval/decoders/openai.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/alpaca_eval/decoders/openai.py b/src/alpaca_eval/decoders/openai.py index 8a7981ec..03120c38 100644 --- a/src/alpaca_eval/decoders/openai.py +++ b/src/alpaca_eval/decoders/openai.py @@ -237,7 +237,7 @@ def _openai_completion_helper( break except openai.OpenAIError as e: logging.warning(f"OpenAIError: {e}.") - if "Please reduce your prompt" in str(e): + if "Please reduce" in str(e): kwargs["max_tokens"] = int(kwargs["max_tokens"] * 0.8) logging.warning(f"Reducing target length to {kwargs['max_tokens']}, Retrying...") if kwargs["max_tokens"] == 0: