]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
examples : add model conversion tool/example (#15455)
authorDaniel Bevenius <redacted>
Thu, 21 Aug 2025 10:16:54 +0000 (12:16 +0200)
committerGitHub <redacted>
Thu, 21 Aug 2025 10:16:54 +0000 (12:16 +0200)
commit2758fa10dab0556e6c3f130e664750fd6773dc7c
tree4220e2f2beb075fe78e52cb5fc83e059d68c0a40
parentb108e429043ee5c9fc8fa4957a0a52c3e490d5c9
examples : add model conversion tool/example (#15455)

* examples : add model conversion tool/example

This commit adds an "example/tool" that is intended to help in the
process of converting models to GGUF. Currently it supports normal
causal models and embedding models. The readme contains instructions and
command to guide through the process.

The motivation for this to have a structured and repeatable process for
model conversions and hopefully with time improve upon it to make the
process easier and more reliable. We have started to use this for new
model conversions internally and will continue doing so and improve it
as we go along. Perhaps with time this should be placed in a different
directory than the examples directory, but for now it seems like a good
place to keep it while we are still developing it.

* squash! examples : add model conversion tool/example

Remove dependency on scikit-learn in model conversion example.

* squash! examples : add model conversion tool/example

Update transformer dep to use non-dev version. And also import
`AutoModelForCausalLM` instead of `AutoModel` to ensure compatibility
with the latest version.

* squash! examples : add model conversion tool/example

Remove the logits requirements file from the all requirements file.
33 files changed:
examples/CMakeLists.txt
examples/model-conversion/.gitignore [new file with mode: 0644]
examples/model-conversion/CMakeLists.txt [new file with mode: 0644]
examples/model-conversion/Makefile [new file with mode: 0644]
examples/model-conversion/README.md [new file with mode: 0644]
examples/model-conversion/logits.cpp [new file with mode: 0644]
examples/model-conversion/requirements.txt [new file with mode: 0644]
examples/model-conversion/scripts/causal/compare-embeddings-logits.sh [new file with mode: 0755]
examples/model-conversion/scripts/causal/compare-logits.py [new file with mode: 0755]
examples/model-conversion/scripts/causal/convert-model.sh [new file with mode: 0755]
examples/model-conversion/scripts/causal/run-casual-gen-embeddings-org.sh [new file with mode: 0755]
examples/model-conversion/scripts/causal/run-converted-model-embeddings-logits.sh [new file with mode: 0755]
examples/model-conversion/scripts/causal/run-converted-model.sh [new file with mode: 0755]
examples/model-conversion/scripts/causal/run-org-model.py [new file with mode: 0755]
examples/model-conversion/scripts/embedding/compare-embeddings-logits.sh [new file with mode: 0755]
examples/model-conversion/scripts/embedding/convert-model.sh [new file with mode: 0755]
examples/model-conversion/scripts/embedding/run-converted-model.sh [new file with mode: 0755]
examples/model-conversion/scripts/embedding/run-original-model.py [new file with mode: 0755]
examples/model-conversion/scripts/readme.md.template [new file with mode: 0644]
examples/model-conversion/scripts/utils/check-nmse.py [new file with mode: 0755]
examples/model-conversion/scripts/utils/create-collection-add-model.sh [new file with mode: 0644]
examples/model-conversion/scripts/utils/hf-add-model-to-collection.py [new file with mode: 0755]
examples/model-conversion/scripts/utils/hf-create-collection.py [new file with mode: 0755]
examples/model-conversion/scripts/utils/hf-create-model.py [new file with mode: 0755]
examples/model-conversion/scripts/utils/hf-upload-gguf-model.py [new file with mode: 0755]
examples/model-conversion/scripts/utils/inspect-converted-model.sh [new file with mode: 0755]
examples/model-conversion/scripts/utils/inspect-org-model.py [new file with mode: 0755]
examples/model-conversion/scripts/utils/perplexity-gen.sh [new file with mode: 0755]
examples/model-conversion/scripts/utils/perplexity-run-simple.sh [new file with mode: 0755]
examples/model-conversion/scripts/utils/perplexity-run.sh [new file with mode: 0755]
examples/model-conversion/scripts/utils/quantize.sh [new file with mode: 0755]
examples/model-conversion/scripts/utils/run-embedding-server.sh [new file with mode: 0755]
examples/model-conversion/scripts/utils/semantic_check.py [new file with mode: 0644]