Skip to content

Fix off-by-1 in prompt creation#64

Merged
McPatate merged 1 commit intohuggingface:mainfrom
HennerM:fix-prompt-creation
Jan 28, 2024
Merged

Fix off-by-1 in prompt creation#64
McPatate merged 1 commit intohuggingface:mainfrom
HennerM:fix-prompt-creation

Conversation

@HennerM
Copy link
Copy Markdown
Contributor

@HennerM HennerM commented Jan 23, 2024

Both for fill-in-the-middle prompts as well as normal prompts, there is a bug where we cut off one character from the input.

This happens when we are at the end of a line, e.g.

def hello_<CURSOR>

we were clamping the line column from 0 to len_chars() - 1. However it is valid to be "behind" all the characters in a line, and thus the -1 gets us to the wrong position

Copy link
Copy Markdown
Member

@McPatate McPatate left a comment

Choose a reason for hiding this comment

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

These are the kind of errors that mess with my brain 😅

Thanks for all the contributions @HennerM, awesome work!!

@McPatate McPatate merged commit ec2072a into huggingface:main Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants