diff options
author | slaren <slarengh@gmail.com> | 2023-11-19 11:10:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-19 11:10:52 +0100 |
commit | e937066420b79a757bf80e9836eb12b88420a218 (patch) | |
tree | 93a3c3a9889c4367e6e6310674d0661cbf0f5d5f /gguf-py/gguf/gguf_writer.py | |
parent | 28a2e6e7d476717881be6eb9e2d3331342cec57b (diff) |
gguf-py : export chat templates (#4125)
* gguf-py : export chat templates
* llama.cpp : escape new lines in gguf kv info prints
* gguf-py : bump version
* gguf-py : check chat_template type
* gguf-py : initialize chat_template
Diffstat (limited to 'gguf-py/gguf/gguf_writer.py')
-rw-r--r-- | gguf-py/gguf/gguf_writer.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gguf-py/gguf/gguf_writer.py b/gguf-py/gguf/gguf_writer.py index c3b8c588..ab7382c4 100644 --- a/gguf-py/gguf/gguf_writer.py +++ b/gguf-py/gguf/gguf_writer.py @@ -399,6 +399,9 @@ class GGUFWriter: def add_add_eos_token(self, value: bool) -> None: self.add_bool(Keys.Tokenizer.ADD_EOS, value) + def add_chat_template(self, value: str) -> None: + self.add_string(Keys.Tokenizer.CHAT_TEMPLATE, value) + def _pack(self, fmt: str, value: Any, skip_pack_prefix: bool = False) -> bytes: pack_prefix = '' if not skip_pack_prefix: |