From 42f16332cf0f96f243f9797d6406283865254355 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Fri, 10 Nov 2023 08:24:51 +0000 Subject: [PATCH] fix: prevent IndexError in fine-tunes CLI (#768) --- src/openai/lib/_validators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openai/lib/_validators.py b/src/openai/lib/_validators.py index 8e4ed3c9f4..c8608c0cef 100644 --- a/src/openai/lib/_validators.py +++ b/src/openai/lib/_validators.py @@ -407,7 +407,7 @@ def completions_space_start_validator(df: pd.DataFrame) -> Remediation: """ def add_space_start(x: Any) -> Any: - x["completion"] = x["completion"].apply(lambda x: ("" if x[0] == " " else " ") + x) + x["completion"] = x["completion"].apply(lambda s: ("" if s.startswith(" ") else " ") + s) return x optional_msg = None