Commit 460a2821

Stainless Bot <107565488+stainless-bot@users.noreply.github.com>
2023-11-10 16:24:51
fix: prevent IndexError in fine-tunes CLI (#768)
1 parent b185cb3
Changed files (1)
src
openai
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