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

AutocompleteTemplate: Use modelfile template for granite3 #3314

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

Conversation

halfline
Copy link
Contributor

granite3 is currently using the "hole filler" template since it lacks FIM support. This template is getting sent to ollama raw, so the template from the model file is not getting applied to it.

This commit ensures the proper format is fed to the model, by moving the hole filler system message to be a global constant, and using it in the existing holeFillerTemplate and a new granteHoleFillerTemplate that also applies the appropiate model specific formatting.

granite3 is currently using the "hole filler" template since it
lacks FIM support. This template is getting sent to ollama raw,
so the template from the model file is not getting applied to it.

This commit ensures the proper format is fed to the model, by
moving the hole filler system message to be a global constant, and
using it in the existing holeFillerTemplate and a new
granteHoleFillerTemplate that also applies the appropiate model
specific formatting.
Copy link

netlify bot commented Dec 11, 2024

Deploy Preview for continuedev ready!

Name Link
🔨 Latest commit 6e5c58c
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/675980acc9a76900084104db
😎 Deploy Preview https://deploy-preview-3314--continuedev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@halfline
Copy link
Contributor Author

this is marked draft because i haven't tested it yet, so haven't confirmed it doesn't regress results.

I just sketched it out a few days ago after noticing the problem when looking at ollama debug output.

I will test eventually, but for now, I just want to get it off my machine so I don't lose track of it.

) {
return holeFillerTemplate;
}

if (lowerCaseModel.includes("granite3")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

lowerCaseModel.includes("granite3") && !lowerCaseModel.includes("-code")

future proofing the next models that'll support FIM

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.

2 participants