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

[PR?] Fill in the middle completer #113

Open
NightMachinery opened this issue Apr 23, 2024 · 7 comments
Open

[PR?] Fill in the middle completer #113

NightMachinery opened this issue Apr 23, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@NightMachinery
Copy link

NightMachinery commented Apr 23, 2024

I have written a usable fill-in-the-middle function. The code is available here (look for night/ellama-code-fill-in-the-middle), and I can clean it up further for inclusion in ellama, if there's interest. Or someone else can do that.

Here are some demos with llama3-70b-8192:

ellama_fill_middle_v2.mp4
ellama_fill_middle.mp4

The highlights will be cleared the next time you press C-g, though this depends on Doom's doom-escape-hook; I couldn't find a built-in hook for keyboard-quit.

@s-kostyaev
Copy link
Owner

Hi @NightMachinery
Looks interesting.
Have you signed FSF papers? If so, open PR 🙂

@NightMachinery
Copy link
Author

I have signed the copyright papers for emacs before; are these the same?

I'll use this function for a while to see how robust it is. Its implementation is very hacky currently, and the heuristics used look somewhat model-dependent.

@s-kostyaev
Copy link
Owner

s-kostyaev commented Apr 24, 2024

I have signed the copyright papers for emacs before; are these the same?

Yes. It means you don't need to do it second time.

I'll use this function for a while to see how robust it is. Its implementation is very hacky currently, and the heuristics used look somewhat model-dependent.

we can improve it during code review. And it will be model dependent, because different models handle FIM differently, has different tags etc.

@NightMachinery
Copy link
Author

different models handle FIM differently

The current implementation is a hack that uses normal LLMs tuned for chat. If the model supported FIM, the implementation would become a lot simpler. I am not aware of any FIM API though. (Surely there must be some open models, but is there anything competent?)

@s-kostyaev
Copy link
Owner

s-kostyaev commented Apr 24, 2024

See codeqwen, deepseek coder (not latest one) and Starcoder 2 7b (in 15b fim is broken).

@NightMachinery
Copy link
Author

See codeqwen, deepseek coder (not latest one) and Starcoder 2 7b (in 15b fim is broken).

Is there any cloud API for these models? (e.g., on OpenRouter or OpenAI)

I think the llm backend doesn't support FIM completion, either.

@s-kostyaev
Copy link
Owner

I don't think llm should do something to add fim support, it's about right prompt format.
I don't know about cloud APIs, I don't use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants