radiance 1.10.0

LoRA for image and video generators:
- civitai and Hugging Face adapter files as published: kohya, ComfyUI and diffusers/PEFT key names;
  LoRA, LoCon, LoHa, LoKr and full-weight diffs; DoRA, OFT and Tucker are refused by name
- stacked per request with a strength each, through the `loras` field or <lora:name:strength> tags
  in the prompt; --lora-dir serves every file in a directory, GET /v1/loras lists them, and
  --max-loras / --max-lora-rank size the slots on the card (generators default to rank 64)
- Krea 2, Qwen-Image 2.1, FLUX.3 [klein], MiniMax H3, LTX-2.5, Anima and SDXL

New models:
- Anima (base, aesthetic and turbo): Cosmos-Predict2 DiT with the Qwen3-0.6B text encoder and the
  Qwen-Image VAE, on one card
- Stable Diffusion XL and its single-file finetunes (Illustrious, NoobAI including V-Pred, Pony),
  read as civitai ships them, with the Euler, Euler a and DPM++ 2M samplers

Recipes:
- q38-27b-mxfp4-df2: any bf16 Qwen3.8-27B or finetune at MXFP4 with the DFlash2 drafter
- Krea 2 finetunes from civitai: scripts/krea2_native.py reads Krea's own key names, and
  krea-2-fp8-unscaled keeps a plain-fp8 file's codes exactly

Changes: --max-num-batched-tokens defaults to 2048 (was 8192). Plugin ABI 25: out-of-tree plugins
must be rebuilt.
This commit is contained in:
Deadcode committed 2026-10-20 21:05:16 +02:00
1 parent 685ec5bd85
commit 4246a1dd04
124 files changed
+14326 -387

No files matched your search

+138 -32
View File
@@ -869,6 +869,40 @@ struct TestStrings : StringSink {
};
} /* namespace */
namespace {
/* `in` through the .rad's vocab section and back into `out`. */
int round_trip(const VocabBuild& in, VocabBuild* out) {
TestStrings strings;
std::vector<uint8_t> section;
/* Lay the file out as rad-convert does: header, string blob, vocab section. The serialiser
* writes absolute offsets, so the section must know where it lands before it is written, and
* it lands 8-aligned, as the writer places it, because the reader takes the header as a typed
* pointer into the file. */
const uint64_t str_off = sizeof(RadFileHeader);
RAD_TRY(vocab_serialize(in, strings, 0, section)); /* pass 1: sizes only */
const uint64_t sec_off = (str_off + strings.blob.size() + 7) & ~(uint64_t)7;
TestStrings strings2;
section.clear();
RAD_TRY(vocab_serialize(in, strings2, sec_off, section));
std::vector<uint8_t> file(sec_off + section.size(), 0);
RadFileHeader* fh = reinterpret_cast<RadFileHeader*>(file.data());
fh->magic = RAD_MAGIC;
fh->version = RAD_FORMAT_VER;
fh->str_off = str_off;
fh->str_bytes = strings2.blob.size();
fh->vocab_off = sec_off;
fh->vocab_bytes = section.size();
std::memcpy(file.data() + str_off, strings2.blob.data(), strings2.blob.size());
std::memcpy(file.data() + sec_off, section.data(), section.size());
return vocab_deserialize(file.data(), file.size(),
reinterpret_cast<const RadVocabHeader*>(file.data() + sec_off), *out);
}
} /* namespace */
TEST(vocab_section_round_trip) {
VocabBuild in;
in.kind = RAD_TOK_BPE;
@@ -885,35 +919,8 @@ TEST(vocab_section_round_trip) {
VocabStep s2; s2.kind = RAD_PRE_BYTELEVEL; s2.flags = 2; in.steps.push_back(s2);
VocabStep s3; s3.kind = RAD_DEC_BYTELEVEL; in.steps.push_back(s3);
TestStrings strings;
std::vector<uint8_t> section;
/* Lay the file out as rad-convert does: header, string blob, vocab section. The serialiser
* writes absolute offsets, so the section must know where it lands before it is written, and
* it lands 8-aligned, as the writer places it, because the reader takes the header as a typed
* pointer into the file. */
const uint64_t str_off = sizeof(RadFileHeader);
CHECK_OK(vocab_serialize(in, strings, 0, section)); /* pass 1: sizes only */
const uint64_t sec_off = (str_off + strings.blob.size() + 7) & ~(uint64_t)7;
TestStrings strings2;
section.clear();
CHECK_OK(vocab_serialize(in, strings2, sec_off, section));
std::vector<uint8_t> file(sec_off + section.size(), 0);
RadFileHeader* fh = reinterpret_cast<RadFileHeader*>(file.data());
fh->magic = RAD_MAGIC;
fh->version = RAD_FORMAT_VER;
fh->str_off = str_off;
fh->str_bytes = strings2.blob.size();
fh->vocab_off = sec_off;
fh->vocab_bytes = section.size();
std::memcpy(file.data() + str_off, strings2.blob.data(), strings2.blob.size());
std::memcpy(file.data() + sec_off, section.data(), section.size());
VocabBuild out;
CHECK_OK(vocab_deserialize(file.data(), file.size(),
reinterpret_cast<const RadVocabHeader*>(file.data() + sec_off),
out));
CHECK_OK(round_trip(in, &out));
CHECK_EQ(out.kind, in.kind);
CHECK(out.tokens == in.tokens);
@@ -985,7 +992,7 @@ TEST(parse_tokenizer_json_chain) {
* interpreted rather than hashed. */
TEST(parse_tokenizer_json_refuses_unknown_components) {
const char* js = R"JSON({
"normalizer": { "type": "Precompiled", "precompiled_charsmap": "AAAA" },
"normalizer": { "type": "StripAccents" },
"pre_tokenizer": { "type": "ByteLevel" },
"model": { "type": "BPE", "vocab": {"a": 0}, "merges": [] }
})JSON";
@@ -995,7 +1002,7 @@ TEST(parse_tokenizer_json_refuses_unknown_components) {
/* A step the tokenizer does not run is refused at load, not passed over on every encode. */
TEST(a_vocab_with_an_unknown_step_does_not_load) {
for (uint32_t kind : { 9u, 39u, 70u, 200u }) {
for (uint32_t kind : { 10u, 41u, 70u, 200u }) {
VocabBuild vb;
vb.kind = RAD_TOK_BPE;
vb.tokens = { "a" };
@@ -1498,7 +1505,7 @@ TEST(decompose_and_compose_are_inverses_over_the_canonical_forms) {
namespace {
/* BEGIN generated by mk_tokenizer_goldens.py (tokenizers 0.23.2) */
/* BEGIN generated by mk_tokenizer_goldens.py (tokenizers 0.23.3) */
struct DecodeGolden { const char* fixture; std::vector<int32_t> ids; const char* text; };
struct PretokGolden { const char* name; const char* json; std::vector<int32_t> ids; };
@@ -1676,6 +1683,49 @@ const std::vector<std::pair<const char*, EncodeGolden>>& metaspace_special_golde
return v;
}
const char* const kClipLike = R"JSON({"added_tokens": [{"id": 620, "content": "<|startoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "special": true}, {"id": 621, "content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true}], "normalizer": {"type": "Sequence", "normalizers": [{"type": "NFC"}, {"type": "Replace", "pattern": {"Regex": "\\s+"}, "content": " "}, {"type": "Lowercase"}]}, "pre_tokenizer": {"type": "Sequence", "pretokenizers": [{"type": "Split", "pattern": {"Regex": "'s|'t|'re|'ve|'m|'ll|'d|[\\p{L}]+|[\\p{N}]|[^\\s\\p{L}\\p{N}]+"}, "behavior": "Removed", "invert": true}, {"type": "ByteLevel", "add_prefix_space": false, "trim_offsets": true}]}, "post_processor": {"type": "RobertaProcessing", "sep": ["<|endoftext|>", 621], "cls": ["<|startoftext|>", 620], "trim_offsets": false, "add_prefix_space": false}, "decoder": {"type": "ByteLevel", "add_prefix_space": true, "trim_offsets": true}, "model": {"type": "BPE", "dropout": null, "unk_token": "<|endoftext|>", "continuing_subword_prefix": "", "end_of_word_suffix": "</w>", "fuse_unk": false, "vocab": {"!": 0, "\"": 1, "#": 2, "$": 3, "%": 4, "&": 5, "'": 6, "(": 7, ")": 8, "*": 9, "+": 10, ",": 11, "-": 12, ".": 13, "/": 14, "0": 15, "1": 16, "2": 17, "3": 18, "4": 19, "5": 20, "6": 21, "7": 22, "8": 23, "9": 24, ":": 25, ";": 26, "<": 27, "=": 28, ">": 29, "?": 30, "@": 31, "A": 32, "B": 33, "C": 34, "D": 35, "E": 36, "F": 37, "G": 38, "H": 39, "I": 40, "J": 41, "K": 42, "L": 43, "M": 44, "N": 45, "O": 46, "P": 47, "Q": 48, "R": 49, "S": 50, "T": 51, "U": 52, "V": 53, "W": 54, "X": 55, "Y": 56, "Z": 57, "[": 58, "\\": 59, "]": 60, "^": 61, "_": 62, "`": 63, "a": 64, "b": 65, "c": 66, "d": 67, "e": 68, "f": 69, "g": 70, "h": 71, "i": 72, "j": 73, "k": 74, "l": 75, "m": 76, "n": 77, "o": 78, "p": 79, "q": 80, "r": 81, "s": 82, "t": 83, "u": 84, "v": 85, "w": 86, "x": 87, "y": 88, "z": 89, "{": 90, "|": 91, "}": 92, "~": 93, "¡": 94, "¢": 95, "£": 96, "¤": 97, "¥": 98, "¦": 99, "§": 100, "¨": 101, "©": 102, "ª": 103, "«": 104, "¬": 105, "®": 106, "¯": 107, "°": 108, "±": 109, "²": 110, "³": 111, "´": 112, "µ": 113, "": 114, "·": 115, "¸": 116, "¹": 117, "º": 118, "»": 119, "¼": 120, "½": 121, "¾": 122, "¿": 123, "À": 124, "Á": 125, "Â": 126, "Ã": 127, "Ä": 128, "Å": 129, "Æ": 130, "Ç": 131, "È": 132, "É": 133, "Ê": 134, "Ë": 135, "Ì": 136, "Í": 137, "Î": 138, "Ï": 139, "Ð": 140, "Ñ": 141, "Ò": 142, "Ó": 143, "Ô": 144, "Õ": 145, "Ö": 146, "×": 147, "Ø": 148, "Ù": 149, "Ú": 150, "Û": 151, "Ü": 152, "Ý": 153, "Þ": 154, "ß": 155, "à": 156, "á": 157, "â": 158, "ã": 159, "ä": 160, "å": 161, "æ": 162, "ç": 163, "è": 164, "é": 165, "ê": 166, "ë": 167, "ì": 168, "í": 169, "î": 170, "ï": 171, "ð": 172, "ñ": 173, "ò": 174, "ó": 175, "ô": 176, "õ": 177, "ö": 178, "÷": 179, "ø": 180, "ù": 181, "ú": 182, "û": 183, "ü": 184, "ý": 185, "þ": 186, "ÿ": 187, "Ā": 188, "ā": 189, "Ă": 190, "ă": 191, "Ą": 192, "ą": 193, "Ć": 194, "ć": 195, "Ĉ": 196, "ĉ": 197, "Ċ": 198, "ċ": 199, "Č": 200, "č": 201, "Ď": 202, "ď": 203, "Đ": 204, "đ": 205, "Ē": 206, "ē": 207, "Ĕ": 208, "ĕ": 209, "Ė": 210, "ė": 211, "Ę": 212, "ę": 213, "Ě": 214, "ě": 215, "Ĝ": 216, "ĝ": 217, "Ğ": 218, "ğ": 219, "Ġ": 220, "ġ": 221, "Ģ": 222, "ģ": 223, "Ĥ": 224, "ĥ": 225, "Ħ": 226, "ħ": 227, "Ĩ": 228, "ĩ": 229, "Ī": 230, "ī": 231, "Ĭ": 232, "ĭ": 233, "Į": 234, "į": 235, "İ": 236, "ı": 237, "IJ": 238, "ij": 239, "Ĵ": 240, "ĵ": 241, "Ķ": 242, "ķ": 243, "ĸ": 244, "Ĺ": 245, "ĺ": 246, "Ļ": 247, "ļ": 248, "Ľ": 249, "ľ": 250, "Ŀ": 251, "ŀ": 252, "Ł": 253, "ł": 254, "Ń": 255, "!</w>": 256, "\"</w>": 257, "#</w>": 258, "$</w>": 259, "%</w>": 260, "&</w>": 261, "'</w>": 262, "(</w>": 263, ")</w>": 264, "*</w>": 265, "+</w>": 266, ",</w>": 267, "-</w>": 268, ".</w>": 269, "/</w>": 270, "0</w>": 271, "1</w>": 272, "2</w>": 273, "3</w>": 274, "4</w>": 275, "5</w>": 276, "6</w>": 277, "7</w>": 278, "8</w>": 279, "9</w>": 280, ":</w>": 281, ";</w>": 282, "<</w>": 283, "=</w>": 284, "></w>": 285, "?</w>": 286, "@</w>": 287, "A</w>": 288, "B</w>": 289, "C</w>": 290, "D</w>": 291, "E</w>": 292, "F</w>": 293, "G</w>": 294, "H</w>": 295, "I</w>": 296, "J</w>": 297, "K</w>": 298, "L</w>": 299, "M</w>": 300, "N</w>": 301, "O</w>": 302, "P</w>": 303, "Q</w>": 304, "R</w>": 305, "S</w>": 306, "T</w>": 307, "U</w>": 308, "V</w>": 309, "W</w>": 310, "X</w>": 311, "Y</w>": 312, "Z</w>": 313, "[</w>": 314, "\\</w>": 315, "]</w>": 316, "^</w>": 317, "_</w>": 318, "`</w>": 319, "a</w>": 320, "b</w>": 321, "c</w>": 322, "d</w>": 323, "e</w>": 324, "f</w>": 325, "g</w>": 326, "h</w>": 327, "i</w>": 328, "j</w>": 329, "k</w>": 330, "l</w>": 331, "m</w>": 332, "n</w>": 333, "o</w>": 334, "p</w>": 335, "q</w>": 336, "r</w>": 337, "s</w>": 338, "t</w>": 339, "u</w>": 340, "v</w>": 341, "w</w>"Line truncated
const std::vector<EncodeGolden>& clip_goldens() {
static const std::vector<EncodeGolden> v = {
{ "a photo of a cat", { 320, 608, 513, 320, 555 }, { 620, 320, 608, 513, 320, 555, 621 } },
{ "1girl, solo, masterpiece, best quality, (absurdres:1.2), looking_at_viewer, hatsune_miku", { 272, 576, 267, 614, 267, 594, 267, 554, 611, 267, 263, 64, 65, 82, 84, 81, 67, 81, 68, 338, 281, 272, 269, 273, 8, 267, 593, 318, 514, 318, 619, 267, 71, 64, 83, 615, 324, 318, 76, 72, 74, 340 }, { 620, 272, 576, 267, 614, 267, 594, 267, 554, 611, 267, 263, 64, 65, 82, 84, 81, 67, 81, 68, 338, 281, 272, 269, 273, 8, 267, 593, 318, 514, 318, 619, 267, 71, 64, 83, 615, 324, 318, 76, 72, 74, 340, 621 } },
{ "A Photograph of the Mountains, it's DON'T stop", { 320, 609, 513, 618, 598, 267, 524, 528, 568, 529, 616 }, { 620, 320, 609, 513, 618, 598, 267, 524, 528, 568, 529, 616, 621 } },
{ "1024x1024 2.5 v1.0", { 272, 271, 273, 275, 343, 272, 271, 273, 275, 273, 269, 276, 341, 272, 269, 271 }, { 620, 272, 271, 273, 275, 343, 272, 271, 273, 275, 273, 269, 276, 341, 272, 269, 271, 621 } },
{ "Caf\xc3\xa9 na\xc3\xafve \xe6\x9d\xb1\xe4\xba\xac\xe3\x82\xbf\xe3\x83\xaf\xe3\x83\xbc \xec\x84\x9c\xec\x9a\xb8 \xf0\x9f\x8d\xa3\xf0\x9f\x91\xa9\xe2\x80\x8d\xf0\x9f\x91\xa9\xe2\x80\x8d\xf0\x9f\x91\xa7 \xc4\xb0stanbul \xce\xa3\xce\x8a\xce\xa3\xce\xa5\xce\xa6\xce\x9f\xce\xa3", { 66, 64, 69, 127, 358, 77, 64, 127, 107, 85, 324, 162, 251, 109, 160, 118, 105, 159, 224, 123, 159, 225, 107, 159, 225, 376, 168, 226, 250, 168, 248, 372, 172, 253, 235, 96, 172, 253, 239, 102, 158, 222, 235, 172, 253, 239, 102, 158, 222, 235, 172, 253, 239, 356, 328, 136, 485, 517, 64, 77, 65, 84, 331, 139, 225, 138, 107, 139, 225, 139, 227, 139, 228, 138, 123, 139, 481 }, { 620, 66, 64, 69, 127, 358, 77, 64, 127, 107, 85, 324, 162, 251, 109, 160, 118, 105, 159, 224, 123, 159, 225, 107, 159, 225, 376, 168, 226, 250, 168, 248, 372, 172, 253, 235, 96, 172, 253, 239, 102, 158, 222, 235, 172, 253, 239, 102, 158, 222, 235, 172, 253, 239, 356, 328, 136, 485, 517, 64, 77, 65, 84, 331, 139, 225, 138, 107, 139, 225, 139, 227, 139, 228, 138, 123, 139, 481, 621 } },
{ " many spaces\t\ttabs\n\nnewlines ", { 76, 64, 77, 344, 82, 79, 64, 66, 68, 338, 518, 65, 338, 77, 68, 86, 75, 512, 68, 338 }, { 620, 76, 64, 77, 344, 82, 79, 64, 66, 68, 338, 518, 65, 338, 77, 68, 86, 75, 512, 68, 338, 621 } },
{ "...!!!??? ((()))[[]]", { 13, 13, 13, 0, 0, 0, 30, 30, 286, 7, 7, 7, 8, 8, 8, 58, 58, 60, 316 }, { 620, 13, 13, 13, 0, 0, 0, 30, 30, 286, 7, 7, 7, 8, 8, 8, 58, 58, 60, 316, 621 } },
{ "", { }, { 620, 621 } },
{ "a", { 320 }, { 620, 320, 621 } },
{ "<|startoftext|>a cat<|endoftext|>", { 620, 320, 555, 621 }, { 620, 620, 320, 555, 621, 621 } },
{ "x<|StartOfText|>y", { 343, 620, 344 }, { 620, 343, 620, 344, 621 } },
{ "a</w>b catcat", { 320, 27, 270, 342, 285, 321, 66, 64, 83, 555 }, { 620, 320, 27, 270, 342, 285, 321, 66, 64, 83, 555, 621 } },
{ "photographphotograph", { 525, 78, 577, 71, 609 }, { 620, 525, 78, 577, 71, 609, 621 } },
{ "it'sit's'll", { 524, 528, 524, 528, 6, 75, 331 }, { 620, 524, 528, 524, 528, 6, 75, 331, 621 } },
};
return v;
}
/* The decode of every CLIP golden with special tokens skipped, as HF reports it. */
const std::vector<const char*>& clip_decoded() {
static const std::vector<const char*> v = {
"a</w>photo</w>of</w>a</w>cat</w>",
"1</w>girl</w>,</w>solo</w>,</w>masterpiece</w>,</w>best</w>quality</w>,</w>(</w>absurdres</w>:</w>1</w>.</w>2</w>),</w>looking</w>_</w>at</w>_</w>viewer</w>,</w>hatsune</w>_</w>miku</w>",
"a</w>photograph</w>of</w>the</w>mountains</w>,</w>it</w>'s</w>don</w>'t</w>stop</w>",
"1</w>0</w>2</w>4</w>x</w>1</w>0</w>2</w>4</w>2</w>.</w>5</w>v</w>1</w>.</w>0</w>",
"caf\xc3\xa9</w>na\xc3\xafve</w>\xe6\x9d\xb1\xe4\xba\xac\xe3\x82\xbf\xe3\x83\xaf\xe3\x83\xbc</w>\xec\x84\x9c\xec\x9a\xb8</w>\xf0\x9f\x8d\xa3\xf0\x9f\x91\xa9\xe2\x80\x8d\xf0\x9f\x91\xa9\xe2\x80\x8d\xf0\x9f\x91\xa7</w>i</w>\xcc\x87</w>stanbul</w>\xcf\x83\xce\xaf\xcf\x83\xcf\x85\xcf\x86\xce\xbf\xcf\x83</w>",
"many</w>spaces</w>tabs</w>newlines</w>",
"...!!!???</w>((()))[[]]</w>",
"",
"a</w>",
"a</w>cat</w>",
"x</w>y</w>",
"a</w></</w>w</w>></w>b</w>catcat</w>",
"photographphotograph</w>",
"it</w>'s</w>it</w>'s</w>'ll</w>",
};
return v;
}
/* END generated by mk_tokenizer_goldens.py */
} /* namespace */
@@ -1794,6 +1844,58 @@ TEST(the_gemma_shaped_tokenizer_encodes_as_huggingface) {
CHECK_EQ(k, gemma_decoded().size());
}
/* CLIP's shape (Stable Diffusion's text encoders): an NFC / whitespace-collapse / Lowercase
* normaliser, a Split that keeps letter runs, single digits and punctuation runs, ByteLevel, BPE
* whose word-final symbols carry the "</w>" suffix, RobertaProcessing `<|startoftext|> $A
* <|endoftext|>`, and `<|startoftext|>` matched in the normalised text (so `<|StartOfText|>` is it
* too). Encoded with and without the framing and decoded, against HuggingFace. */
TEST(the_clip_shaped_tokenizer_encodes_as_huggingface) {
VocabBuild vb;
REQUIRE(parse_tokenizer_json_buf(kClipLike, "clip_like", vb) >= 0);
CHECK(vb.add_bos);
CHECK(vb.add_eos);
CHECK_EQ(vb.bos, 620);
CHECK_EQ(vb.eos, 621);
/* Served as a container holds it: the suffix and the normalised added token are steps. */
VocabBuild baked;
REQUIRE(round_trip(vb, &baked) == RAD_OK);
auto v = std::make_shared<Vocab>();
REQUIRE(v->load(std::move(baked)) >= 0);
Tokenizer t;
CHECK_OK(t.init(v));
size_t k = 0;
for (const EncodeGolden& g : clip_goldens()) {
std::vector<int32_t> plain, special;
CHECK_OK(t.encode(g.text, plain, /*add_special=*/false, /*parse_special=*/true));
CHECK_OK(t.encode(g.text, special, /*add_special=*/true, /*parse_special=*/true));
CHECK(plain == g.ids);
/* A text opening with the BOS token gets a second one, as in HuggingFace: CLIP's BOS
* is matched in the normalised text, after Tokenizer::encode decides on adding one. */
CHECK(special == g.with_special);
if (plain != g.ids) {
std::string got;
for (int32_t id : plain) got += std::to_string(id) + ",";
fprintf(stderr, " \"%s\": %s\n", g.text, got.c_str());
}
CHECK_EQ(t.decode(g.with_special), std::string(clip_decoded()[k]));
CHECK_EQ(streamed(v, g.with_special), std::string(clip_decoded()[k]));
++k;
}
CHECK_EQ(k, clip_decoded().size());
/* A token matched in the normalised text follows parse_special as the raw ones do, through
* the segment cache as well: the same long text with it off and then on. */
std::string text;
for (int i = 0; i < 30; ++i) text += "a photo of a cat <|StartOfText|> ";
for (int pass = 0; pass < 2; ++pass) {
std::vector<int32_t> off, on;
CHECK_OK(t.encode(text, off, false, /*parse_special=*/false));
CHECK_OK(t.encode(text, on, false, /*parse_special=*/true));
CHECK_EQ(std::count(off.begin(), off.end(), 620), (ptrdiff_t)0);
CHECK_EQ(std::count(on.begin(), on.end(), 620), (ptrdiff_t)30);
}
}
/* Metaspace's "first" scheme prepends the replacement only where the text starts: a segment after
* a special token ("[INST]Hi", "<s>Hi") has a non-zero original offset in HuggingFace and gets
* none, where "always" gives every segment one. Encoded through the segment cache both cold and
@@ -1851,7 +1953,6 @@ TEST(parse_tokenizer_json_refuses_values_it_cannot_honour) {
bpe(ws, R"(, "decoder": {"type": "Sequence", "decoders": [{"type": "Fuse"},)"
R"( {"type": "Strip", "content": " ", "start": 1, "stop": 0},)"
R"( {"type": "Strip", "content": " ", "start": 1, "stop": 0}]})"),
bpe(ws, "", R"(, "end_of_word_suffix": "</w>")"),
bpe(ws, "", R"(, "continuing_subword_prefix": "##")"),
bpe(ws, "", R"(, "dropout": 0.1)"),
bpe(ws, added(R"("single_word": true, "lstrip": false, "rstrip": false, "normalized": false)")),
@@ -1878,6 +1979,11 @@ TEST(parse_tokenizer_json_refuses_values_it_cannot_honour) {
bpe(ws, R"(, "decoder": {"type": "Sequence", "decoders": [{"type": "Fuse"},)"
R"( {"type": "Strip", "content": " ", "start": 1, "stop": 0}]})"),
bpe(ws, "", R"(, "dropout": null, "continuing_subword_prefix": null, "end_of_word_suffix": null)"),
bpe(ws, "", R"(, "continuing_subword_prefix": "", "end_of_word_suffix": "</w>")"),
/* Lower case already, so the Lowercase normaliser leaves its spelling alone. */
bpe(ws, R"(, "normalizer": {"type": "Lowercase"}, "added_tokens": [{"id": 3, "content": "x",)"
R"( "special": true, "single_word": false, "lstrip": false, "rstrip": false,)"
R"( "normalized": true}])"),
};
for (const std::string& js : accepted) {
VocabBuild vb;