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

Fix the Ollama FIM completion #848

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Fix the Ollama FIM completion #848

wants to merge 7 commits into from

Conversation

jhrozek
Copy link
Contributor

@jhrozek jhrozek commented Jan 30, 2025

We were not passing the suffix at all which was breaking the FIM
completion.

Fixes: #853

JAORMX
JAORMX previously approved these changes Jan 30, 2025
jhrozek and others added 7 commits January 30, 2025 17:05
We just blindly took the first message which could have been a system
message. The prompt is in the user message, so let's pass that.
Some models don't use FIM markers in the code, but use the suffix
top-level attribute instead. If we don't pass it, the FIM won't complete
successfully.
Signed-off-by: Radoslav Dimitrov <[email protected]>
Signed-off-by: Radoslav Dimitrov <[email protected]>
The `raw` parameter tells the LLM to never use natural language, but
just reply in the format of the message. We need to pass that to the
generate call or else we migth get garbage back to the client.
This is just useful to debug the tests
The FIM format didn't match the model it seemed. I replaced it with a
dump of a FIM message I received from Continue.
Copy link
Member

@rdimitrov rdimitrov left a comment

Choose a reason for hiding this comment

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

Nice!

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.

Ollama FIM doesn't work
3 participants