aboutsummaryrefslogtreecommitdiff
path: root/embed.h
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-06-14 16:06:18 +0200
committerOnur Gündüz <ogunduz@gmail.com>2026-06-14 16:41:53 +0200
commitcb1f049e710cf8704ae29811b3058142c7f64840 (patch)
tree85df308a574fbc3408cd88cd82471896337c8669 /embed.h
parentbb41b40bf881a1c59ee0d6153bcb0bb2f7a0044b (diff)
downloadffwd-cb1f049e710cf8704ae29811b3058142c7f64840.tar.gz
ffwd-cb1f049e710cf8704ae29811b3058142c7f64840.zip
all: add Qwen3-Embedding-4B + fix terminal token
Diffstat (limited to 'embed.h')
-rw-r--r--embed.h7
1 files changed, 6 insertions, 1 deletions
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;
/* ========================================================================