]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
model : support granite multilingual embeddings R2 (ibm-granite/granite-embedding...
authorHans Florian <redacted>
Tue, 2 Jun 2026 15:55:11 +0000 (11:55 -0400)
committerGitHub <redacted>
Tue, 2 Jun 2026 15:55:11 +0000 (17:55 +0200)
commitbfb4308b058b334c6e68085c661ec9eb7e3d59f4
tree58f5c21a6a0b677dbdf98c12dd13db1f00b196ce
parent2187e003378e4adf2115ee89595bf58d4ecb75fc
model : support granite multilingual embeddings R2 (ibm-granite/granite-embedding-{97,311}m-multilingual-r2) (#22716)

* Add support for the ibm-granite/granite-embedding-{97m,311m}-multilingual-r2 embedding models:

* Added a version of the gpt4o tokenizer that has a fixed regex (better handling of marks), and different token merging setting for the 97m model
* Reused gemma4 tokenizer for the 311m model

* granite-embedding-*-multilingual-r2 : add support SwiGLU FFN for Granite Embedding Multilingual R2

* added new GGUF key <arch>.hidden_activation (LLM_KV_HIDDEN_ACT) + writer
* added a forward declaration of llm_ffn_op_type to llama-hparams.h
* added llm_ffn_op in hparams
* added LLM_FFN_NONE = 0 sentinel to llm_ffn_op_type (value-initialization), modern-bert: explicitly assigns LLM_FFN_GEGLU before reading GGUF (unchanged).
* centralized hidden_act mapping in llama-model.cpp, added llm_ffn_op_type_from_string() helper, mirroring rope_scaling_type/llama_rope_scaling_type_from_string()
* modern-bert reads the GGUF key (when present) and uses the resulting op in its FFN graph

* Added granite-embedding-{97m,311m}-multilingual-r2 to the converter code

* Added the hashes for the granite embedding multilingual R2 models
* Set the hidden_activation in the GGUF if the field is present in config.json (such as for the granite embedding models)
14 files changed:
conversion/base.py
conversion/bert.py
convert_hf_to_gguf_update.py
gguf-py/gguf/constants.py
gguf-py/gguf/gguf_writer.py
src/llama-arch.cpp
src/llama-arch.h
src/llama-graph.h
src/llama-hparams.h
src/llama-model.cpp
src/llama-model.h
src/llama-vocab.cpp
src/llama-vocab.h
src/models/modern-bert.cpp