-
Notifications
You must be signed in to change notification settings - Fork 37
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
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JAORMX
previously approved these changes
Jan 30, 2025
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.
jhrozek
force-pushed
the
ollama_fim_fix
branch
from
January 30, 2025 20:09
3df7c6c
to
4e2c5f1
Compare
rdimitrov
approved these changes
Jan 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
lukehinds
pushed a commit
that referenced
this pull request
Jan 31, 2025
* Do not send the system message, only the user message to Ollama FIM 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. * Pass the suffix parameter if present to the FIM generate call 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. * Run make format Signed-off-by: Radoslav Dimitrov <[email protected]> * Fix the unit tests for ollama FIM Signed-off-by: Radoslav Dimitrov <[email protected]> * Pass along the `raw` parameter 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. * Print the full reply as debug message in integration tests This is just useful to debug the tests * Adjust the Ollama FIM testcase to match the model we are using The FIM format didn't match the model it seemed. I replaced it with a dump of a FIM message I received from Continue. --------- Signed-off-by: Radoslav Dimitrov <[email protected]> Co-authored-by: Radoslav Dimitrov <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We were not passing the suffix at all which was breaking the FIM
completion.
Fixes: #853