Skip to content

Fix off-by-1 in prompt creation #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 28, 2024

Conversation

HennerM
Copy link
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
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