]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
convert : support models with multiple chat templates (#6588)
authorSigbjørn Skjæret <redacted>
Thu, 18 Apr 2024 11:49:01 +0000 (13:49 +0200)
committerGitHub <redacted>
Thu, 18 Apr 2024 11:49:01 +0000 (14:49 +0300)
commit03c0946d73c63ea73e1d85015b7088298443d438
tree3add06ebc5f14022771887ca0bce636b39ff8633
parente11b2e6e1e18522ca7cf129600875a0f6fb9307d
convert : support models with multiple chat templates (#6588)

* Support converting models with multiple chat templates

Adds the following metadata:
* tokenizer.chat_templates
* tokenizer.chat_template.<name1>
* tokenizer.chat_template.<name2>
* tokenizer.chat_template.<...>

Where `tokenizer.chat_templates` is an array of the template names (except `default`), `default` is added to the regular `tokenizer.chat_template`.

* replace filtered characters with underscore

* New script to add/modify/remove metadata

This scripts creates a copy of a GGUF file and allows you to add/modify/remove metadata in the process.

Most importantly this allows you to update chat templates, either as a string or directly from an updated tokenizer_config.json file.

* Add files via upload

add new script to project/readme

* flake--
gguf-py/README.md
gguf-py/gguf/constants.py
gguf-py/gguf/gguf_writer.py
gguf-py/gguf/vocab.py
gguf-py/pyproject.toml
gguf-py/scripts/__init__.py
gguf-py/scripts/gguf-new-metadata.py [new file with mode: 0644]