Skip to content
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

New {{cursor}} placeholder for prompts #37

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Entaigner
Copy link

Text manipulation around the text cursor

  1. {{cursor}}
  • Returns the text cursors current line
  1. {{cursor:2:5}}
  • Returns the text from... 'cursor line-2 at the start of the line' to 'cursor line+5 at the end of the line'
  1. {{cursor:1:1:'[SOME_MARKER]'}}
  • Like 2. but inserts [SOME_MARKER] at text cursor position

Important:

  • When text is selected the cursor position is always at the end of selection
  • Only one {{cursor}} marker may be included in any prompt

Why: https://huggingface.co/stabilityai/stable-code-3b#run-with-fill-in-middle-fim-%E2%9A%A1%EF%B8%8F

Text manipulation around the text cursor
1. {{cursor}}
  - Returns the text cursors current line
2. {{cursor:2:5}}
  - Returns the text from...
      'cursor line-2 at the start of the line' to
      'cursor line+5 at the end of the line'
3. {{cursor:1:1:'[SOME_MARKER]'}}
  - Like 2. but inserts [SOME_MARKER] at text cursor position

Important:
- When text is selected the cursor position is always at the end of selection
- Only one {{cursor}} marker may be included in any prompt

Why: https://huggingface.co/stabilityai/stable-code-3b#run-with-fill-in-middle-fim-%E2%9A%A1%EF%B8%8F
@Entaigner
Copy link
Author

The pull request might've been a little rash but i got lost in the moment whilst testing a model.

My implementation lacks a comfortable integration into the rest of the project.

Maybe {{selection_with_marker}} to allow the placement of a marker somewhere in the selection. Or keep {{cursor:1:1:'[SOME_MARKER]'}} but without the line deltas {{cursor:'[SOME_MARKER]'}} and select after. Haven't figured it out.

Anyway, thanks for the awesome project.

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.

1 participant