-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat(template): read jinja templates from gguf files #4332
Conversation
Signed-off-by: Ettore Di Giacinto <[email protected]>
✅ Deploy Preview for localai ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
WIP as need to still add mapping between the transformer tokenizer and the templates (see TODO note in code comments) |
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
basic support should work (tested with llama3 prompt), probably is not going to cover all cases as gonja has limitations, but, since this kicks-in when no other template was defined it is safe to merge without drawbacks. |
* Read jinja templates as fallback Signed-off-by: Ettore Di Giacinto <[email protected]> * Move templating out of model loader Signed-off-by: Ettore Di Giacinto <[email protected]> * Test TemplateMessages Signed-off-by: Ettore Di Giacinto <[email protected]> * Set role and content from transformers Signed-off-by: Ettore Di Giacinto <[email protected]> * Tests: be more flexible Signed-off-by: Ettore Di Giacinto <[email protected]> * More jinja Signed-off-by: Ettore Di Giacinto <[email protected]> * Small refactoring and adaptations Signed-off-by: Ettore Di Giacinto <[email protected]> --------- Signed-off-by: Ettore Di Giacinto <[email protected]>
Description
This PR adds automatic detection and parsing of jinja templates in gguf files. If we fail to identify a variant and we do not have already a specific template, it injects the jinja templates which is part of the model metadata if one is found.
Alternatively, it is possible to enable jinja templates manually in the model config file, in the template config section with
jinja_template: true
.Notes for Reviewers
Signed commits