Skip to content

Conversation

danbev
Copy link
Member

@danbev danbev commented Aug 20, 2025

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.


If possible it would be nice to get this merged even if there are probably things we will discover are missing, but hopefully we can add these as we come across them when converting new models. I've used this for one new model thus far and I plan to use it next time, and it would be nice to get this merged and not have to maintain this as separate commit/repo.

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.
@github-actions github-actions bot added examples python python script changes labels Aug 20, 2025
@danbev danbev closed this Aug 20, 2025
@danbev danbev deleted the model-conversion branch August 20, 2025 14:19
@danbev danbev restored the model-conversion branch August 20, 2025 14:21
@danbev danbev reopened this Aug 20, 2025
danbev added 3 commits August 21, 2025 10:24
Remove dependency on scikit-learn in model conversion example.
Update transformer dep to use non-dev version. And also import
`AutoModelForCausalLM` instead of `AutoModel` to ensure compatibility
with the latest version.
Remove the logits requirements file from the all requirements file.
@danbev danbev merged commit 2758fa1 into ggml-org:master Aug 21, 2025
50 checks passed
@danbev danbev deleted the model-conversion branch August 21, 2025 10:17
@DamonFool
Copy link
Contributor

Hi @danbev , thanks for the nice work!

Are you fine to add --extra-index-url https://download.pytorch.org/whl/cpu in the requirement file?
Please see #15475 .
Thanks.

@danbev
Copy link
Member Author

danbev commented Aug 21, 2025

Are you fine to add --extra-index-url https://download.pytorch.org/whl/cpu in the requirement file?

Absolutely, thanks for that!

qnixsynapse pushed a commit to menloresearch/llama.cpp that referenced this pull request Aug 22, 2025
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples python python script changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants