Replies: 1 comment
-
If I remember right, llama-cpp-python tries to guess the chat template based on the metadata available in the loaded model. So for example: To manually set the chat template, using the "mistral-instruct" template found in llama-cpp-python: To get the full list of llama-cpp-python's built-in chat templates, try the following: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Everyone.
Im sure this is a silly question but Ive been at it for hours not. I think im just not getting something obvious.
So each model will have a prefferd chat template and EOS/BOS token. If running models online you can use HF apply_chat_template.
I found that when using llama_cpp locally I can get the metadata and the jinja template from the LLM_Model with;
(
metadata = LLM_Model.metadata
chat_template = metadata.get('tokenizer.chat_template', None)
)
Is this a good method?
How do other people pull and apply chat templates locally for various models?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions