-
-
Notifications
You must be signed in to change notification settings - Fork 331
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
Inline completion strips out new line when it should be kept #1001
Labels
Comments
To fix it we need to: - suggestion = suggestion.lstrip()[len(opening) :].lstrip()
+ suggestion = suggestion.lstrip()[len(opening) :]
# check for the prefix inclusion (only if there was a bad opening)
- if suggestion.startswith(request.prefix):
- suggestion = suggestion[len(request.prefix) :]
+ if suggestion.lstrip().startswith(request.prefix):
+ suggestion = suggestion.lstrip()[len(request.prefix) :] Plus tests cases need to be added in jupyter-ai/packages/jupyter-ai/jupyter_ai/tests/completions/test_handlers.py Lines 101 to 133 in fcb2d71
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
New line is stripped out if model returns
prefix.
Reproduce
# load json file
# load json file import
Expected behavior
Context
This is an issue in
jupyter-ai/packages/jupyter-ai-magics/jupyter_ai_magics/completion_utils.py
Lines 25 to 47 in fcb2d71
The text was updated successfully, but these errors were encountered: