Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openai/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def completions_space_start_validator(df):

def add_space_start(x):
x["completion"] = x["completion"].apply(
lambda x: ("" if x[0] == " " else " ") + x
lambda x: ("" if x == "" or x[0] == " " else " ") + x

This comment was marked as resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the suggestion. I have updated the PR. Also I changed the x in the lambda to s so that it does not clash with the input parameter x.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I've verified that (as before) this makes the test pass when applied on top of b82a3f7.

)
return x

Expand Down