Archived
radiance 1.2.4
- EmbeddingGemma 2 (google/embeddinggemma-2): text, image, video and audio embeddings on the card (libr4d) and on the CPU (libavx); prompt_name, Matryoshka dimensions, image budgets, mixed content parts and the messages form on /v1/embeddings - #43: on serves that lend the activation arena to the experts (Qwen3.8-Flash-Next with expert_tiered), every image after the first read its rows from the wrong place -- garbage replies, or an earlier request's image. Fixed - the Qwen vision towers' attention resolves on the card again (broken on main after 1.2.3, never released) - #42: a warning at startup when amdgpu cwsr_enable is 0, and a stalled queue is reported as slow or stuck; the guide covers the GPU-hang-and-reset chain
This commit is contained in:
1 parent
05af4db458
commit
7d840861af
76 files changed
+8324
-467
No files matched your search
@@ -496,8 +496,9 @@ void read_config_json(const std::string& dir, VocabBuild& out) {
|
||||
out.unk = out.unk >= 0 ? out.unk : token_id("unk_token");
|
||||
out.sep = token_id("sep_token");
|
||||
out.eot = out.eos;
|
||||
out.add_bos = bool_or(c, "add_bos_token", false);
|
||||
out.add_eos = bool_or(c, "add_eos_token", false);
|
||||
/* The default is what tokenizer.json's post-processor already said (interpret_tokenizer_json). */
|
||||
out.add_bos = bool_or(c, "add_bos_token", out.add_bos);
|
||||
out.add_eos = bool_or(c, "add_eos_token", out.add_eos);
|
||||
|
||||
const json* ct = get(c, "chat_template");
|
||||
if (ct && ct->is_string()) out.chat_template = ct->get<std::string>();
|
||||
@@ -573,6 +574,25 @@ int interpret_tokenizer_json(const json& j, uint64_t id_limit, const char* origi
|
||||
|
||||
if (const json* a = get(j, "added_tokens")) RAD_TRY(read_added(*a, out, origin, id_limit));
|
||||
|
||||
/* WHAT `add_special_tokens` ADDS, when the file says it in its post-processor rather than in
|
||||
* tokenizer_config.json. HuggingFace's encode runs the post-processor, so a TemplateProcessing
|
||||
* whose single-sequence template is `<bos> $A <eos>` IS the model's add-BOS-and-EOS rule --
|
||||
* Gemma states it there and nowhere else, and an embedding model fed its input without the
|
||||
* <eos> it was trained to pool over computes a different vector. Only the two shapes that map
|
||||
* onto add_bos / add_eos are read: one special token before the sequence, one after. The
|
||||
* config's own add_bos_token / add_eos_token, read later, win where present. */
|
||||
if (const json* pp = get(j, "post_processor")) {
|
||||
if (str_or(*pp, "type", "") == "TemplateProcessing") {
|
||||
const json* single = get(*pp, "single");
|
||||
if (single && single->is_array() && !single->empty()) {
|
||||
auto special = [](const json& e) -> bool { return e.is_object() && e.contains("SpecialToken"); };
|
||||
const bool seq_in_middle = single->size() >= 2;
|
||||
if (special(single->front()) && seq_in_middle) out.add_bos = true;
|
||||
if (special(single->back()) && seq_in_middle) out.add_eos = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pre.empty() && out.kind == RAD_TOK_BPE) {
|
||||
RAD_ERR("%s: a BPE model with no pre_tokenizer would tokenise the whole prompt as one "
|
||||
"word. Refusing.", origin);
|
||||
|
||||
Reference in new issue
Block a user