From cb1f049e710cf8704ae29811b3058142c7f64840 Mon Sep 17 00:00:00 2001 From: Onur Gündüz Date: Sun, 14 Jun 2026 16:06:18 +0200 Subject: all: add Qwen3-Embedding-4B + fix terminal token --- embed.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'embed.h') diff --git a/embed.h b/embed.h index 764e5c6..f7048b4 100644 --- a/embed.h +++ b/embed.h @@ -57,8 +57,13 @@ typedef struct { embed_attention_mode_t attention_mode; embed_pooling_mode_t pooling_mode; int normalize_embeddings; + /* Qwen3-Embedding pools the last token, which is the tokenizer's + * <|endoftext|> suffix added by its post-processor - not the model's chat + * eos_token_id (<|im_end|>). Text frontends append it and resolve the id + * from the tokenizer exactly like the contextual separator + * (EMBED_CONTEXT_SEPARATOR_TOKEN_ID is the released-model fallback). The + * model forward consumes token ids exactly and never appends. */ int append_terminal_token; - int terminal_token_id; } embed_config_t; /* ======================================================================== -- cgit v1.3.1