Skip to content

Commit 42f1633

Browse files
fix: prevent IndexError in fine-tunes CLI (#768)
1 parent 9ff10df commit 42f1633

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/openai/lib/_validators.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def completions_space_start_validator(df: pd.DataFrame) -> Remediation:
407407
"""
408408

409409
def add_space_start(x: Any) -> Any:
410-
x["completion"] = x["completion"].apply(lambda x: ("" if x[0] == " " else " ") + x)
410+
x["completion"] = x["completion"].apply(lambda s: ("" if s.startswith(" ") else " ") + s)
411411
return x
412412

413413
optional_msg = None

0 commit comments

Comments
 (0)