Add tiny processor fixture for testing
Browse filesFiles changed (8)
- chat_template.jinjaAdded+2
- chat_template.jsonAdded+3
- config.jsonAdded+38
- generation_config.jsonAdded+7
- preprocessor_config.jsonAdded+28
- processor_config.jsonAdded+7
- tokenizer.jsonAdded+846
- tokenizer_config.jsonAdded+64
12{% for message in messages %}{% if message['role'] != 'system' %}{{ message['role'].upper() + ': '}}{% endif %}{# Render all images first #}{% for content in message['content'] | selectattr('type', 'equalto', 'image') %}{{ '<image>' }}{% endfor %}{# Render all text next #}{% if message['role'] != 'assistant' %}{% for content in message['content'] | selectattr('type', 'equalto', 'text') %}{{ content['text'] + ' '}}{% endfor %}{% else %}{% for content in message['content'] | selectattr('type', 'equalto', 'text') %}{% generation %}{{ content['text'] + ' '}}{% endgeneration %}{% endfor %}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ 'ASSISTANT:' }}{% endif %}123{ "chat_template": "{% for message in messages %}{% if message['role'] != 'system' %}{{ message['role'].upper() + ': '}}{% endif %}{# Render all images first #}{% for content in message['content'] | selectattr('type', 'equalto', 'image') %}{{ '<image>\n' }}{% endfor %}{# Render all text next #}{% if message['role'] != 'assistant' %}{% for content in message['content'] | selectattr('type', 'equalto', 'text') %}{{ content['text'] + ' '}}{% endfor %}{% else %}{% for content in message['content'] | selectattr('type', 'equalto', 'text') %}{% generation %}{{ content['text'] + ' '}}{% endgeneration %}{% endfor %}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ 'ASSISTANT:' }}{% endif %}"}1234567891011121314151617181920212223242526272829303132333435363738{
"architectures": [
"LlavaForConditionalGeneration"
],
"ignore_index": -100,
"image_token_index": 32000,
"model_type": "llava",
"pad_token_id": 502,
"projector_hidden_act": "gelu",
"text_config": {
"_name_or_path": "lmsys/vicuna-7b-v1.5",
"architectures": [
"LlamaForCausalLM"
],
"max_position_embeddings": 4096,
"model_type": "llama",
"rms_norm_eps": 1e-05,
"torch_dtype": "float16",
"vocab_size": 32064
},
"tie_word_embeddings": false,
"torch_dtype": "float16",
"transformers_version": "4.36.0.dev0",
"vision_config": {
"hidden_size": 1024,
"image_size": 336,
"intermediate_size": 4096,
"model_type": "clip_vision_model",
"num_attention_heads": 16,
"num_hidden_layers": 24,
"patch_size": 14,
"projection_dim": 768,
"vocab_size": 32000
},
"vision_feature_layer": -2,
"vision_feature_select_strategy": "default",
"vocab_size": 501
}1234567{ "_from_model_config": true, "bos_token_id": 1, "eos_token_id": 2, "pad_token_id": 32001, "transformers_version": "4.36.0.dev0"}12345678910111213141516171819202122232425262728{ "crop_size": { "height": 336, "width": 336 }, "do_center_crop": true, "do_convert_rgb": true, "do_normalize": true, "do_rescale": true, "do_resize": true, "image_mean": [ 0.48145466, 0.4578275, 0.40821073 ], "image_processor_type": "CLIPImageProcessor", "image_std": [ 0.26862954, 0.26130258, 0.27577711 ], "processor_class": "LlavaProcessor", "resample": 3, "rescale_factor": 0.00392156862745098, "size": { "shortest_edge": 336 }}1234567{ "image_token": "<image>", "num_additional_image_tokens": 1, "patch_size": 14, "processor_class": "LlavaProcessor", "vision_feature_select_strategy": "default"}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846{
"version": "1.0",
"truncation": null,
"padding": null,
"added_tokens": [
{
"id": 0,
"content": "<unk>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
{
"id": 1,
"content": "<s>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
{
"id": 2,
"content": "</s>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
{
"id": 501,
"content": "<image>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
{
"id": 502,
"content": "<pad>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
}
],
"normalizer": {
"type": "Sequence",
"normalizers": [
{
"type": "Prepend",
"prepend": "β"
},
{
"type": "Replace",
"pattern": {
"String": " "
},
"content": "β"
}
]
},
"pre_tokenizer": null,
"post_processor": {
"type": "TemplateProcessing",
"single": [
{
"SpecialToken": {
"id": "<s>",
"type_id": 0
}
},
{
"Sequence": {
"id": "A",
"type_id": 0
}
}
],
"pair": [
{
"SpecialToken": {
"id": "<s>",
"type_id": 0
}
},
{
"Sequence": {
"id": "A",
"type_id": 0
}
},
{
"SpecialToken": {
"id": "<s>",
"type_id": 1
}
},
{
"Sequence": {
"id": "B",
"type_id": 1
}
}
],
"special_tokens": {
"<s>": {
"id": "<s>",
"ids": [
1
],
"tokens": [
"<s>"
]
}
}
},
"decoder": {
"type": "Sequence",
"decoders": [
{
"type": "Replace",
"pattern": {
"String": "β"
},
"content": " "
},
{
"type": "ByteFallback"
},
{
"type": "Fuse"
},
{
"type": "Strip",
"content": " ",
"start": 1,
"stop": 0
}
]
},
"model": {
"type": "BPE",
"dropout": null,
"unk_token": "<unk>",
"continuing_subword_prefix": null,
"end_of_word_suffix": null,
"fuse_unk": true,
"byte_fallback": true,
"ignore_merges": false,
"vocab": {
"<unk>": 0,
"<s>": 1,
"</s>": 2,
"<0x00>": 3,
"<0x01>": 4,
"<0x02>": 5,
"<0x03>": 6,
"<0x04>": 7,
"<0x05>": 8,
"<0x06>": 9,
"<0x07>": 10,
"<0x08>": 11,
"<0x09>": 12,
"<0x0A>": 13,
"<0x0B>": 14,
"<0x0C>": 15,
"<0x0D>": 16,
"<0x0E>": 17,
"<0x0F>": 18,
"<0x10>": 19,
"<0x11>": 20,
"<0x12>": 21,
"<0x13>": 22,
"<0x14>": 23,
"<0x15>": 24,
"<0x16>": 25,
"<0x17>": 26,
"<0x18>": 27,
"<0x19>": 28,
"<0x1A>": 29,
"<0x1B>": 30,
"<0x1C>": 31,
"<0x1D>": 32,
"<0x1E>": 33,
"<0x1F>": 34,
"<0x20>": 35,
"<0x21>": 36,
"<0x22>": 37,
"<0x23>": 38,
"<0x24>": 39,
"<0x25>": 40,
"<0x26>": 41,
"<0x27>": 42,
"<0x28>": 43,
"<0x29>": 44,
"<0x2A>": 45,
"<0x2B>": 46,
"<0x2C>": 47,
"<0x2D>": 48,
"<0x2E>": 49,
"<0x2F>": 50,
"<0x30>": 51,
"<0x31>": 52,
"<0x32>": 53,
"<0x33>": 54,
"<0x34>": 55,
"<0x35>": 56,
"<0x36>": 57,
"<0x37>": 58,
"<0x38>": 59,
"<0x39>": 60,
"<0x3A>": 61,
"<0x3B>": 62,
"<0x3C>": 63,
"<0x3D>": 64,
"<0x3E>": 65,
"<0x3F>": 66,
"<0x40>": 67,
"<0x41>": 68,
"<0x42>": 69,
"<0x43>": 70,
"<0x44>": 71,
"<0x45>": 72,
"<0x46>": 73,
"<0x47>": 74,
"<0x48>": 75,
"<0x49>": 76,
"<0x4A>": 77,
"<0x4B>": 78,
"<0x4C>": 79,
"<0x4D>": 80,
"<0x4E>": 81,
"<0x4F>": 82,
"<0x50>": 83,
"<0x51>": 84,
"<0x52>": 85,
"<0x53>": 86,
"<0x54>": 87,
"<0x55>": 88,
"<0x56>": 89,
"<0x57>": 90,
"<0x58>": 91,
"<0x59>": 92,
"<0x5A>": 93,
"<0x5B>": 94,
"<0x5C>": 95,
"<0x5D>": 96,
"<0x5E>": 97,
"<0x5F>": 98,
"<0x60>": 99,
"<0x61>": 100,
"<0x62>": 101,
"<0x63>": 102,
"<0x64>": 103,
"<0x65>": 104,
"<0x66>": 105,
"<0x67>": 106,
"<0x68>": 107,
"<0x69>": 108,
"<0x6A>": 109,
"<0x6B>": 110,
"<0x6C>": 111,
"<0x6D>": 112,
"<0x6E>": 113,
"<0x6F>": 114,
"<0x70>": 115,
"<0x71>": 116,
"<0x72>": 117,
"<0x73>": 118,
"<0x74>": 119,
"<0x75>": 120,
"<0x76>": 121,
"<0x77>": 122,
"<0x78>": 123,
"<0x79>": 124,
"<0x7A>": 125,
"<0x7B>": 126,
"<0x7C>": 127,
"<0x7D>": 128,
"<0x7E>": 129,
"<0x7F>": 130,
"<0x80>": 131,
"<0x81>": 132,
"<0x82>": 133,
"<0x83>": 134,
"<0x84>": 135,
"<0x85>": 136,
"<0x86>": 137,
"<0x87>": 138,
"<0x88>": 139,
"<0x89>": 140,
"<0x8A>": 141,
"<0x8B>": 142,
"<0x8C>": 143,
"<0x8D>": 144,
"<0x8E>": 145,
"<0x8F>": 146,
"<0x90>": 147,
"<0x91>": 148,
"<0x92>": 149,
"<0x93>": 150,
"<0x94>": 151,
"<0x95>": 152,
"<0x96>": 153,
"<0x97>": 154,
"<0x98>": 155,
"<0x99>": 156,
"<0x9A>": 157,
"<0x9B>": 158,
"<0x9C>": 159,
"<0x9D>": 160,
"<0x9E>": 161,
"<0x9F>": 162,
"<0xA0>": 163,
"<0xA1>": 164,
"<0xA2>": 165,
"<0xA3>": 166,
"<0xA4>": 167,
"<0xA5>": 168,
"<0xA6>": 169,
"<0xA7>": 170,
"<0xA8>": 171,
"<0xA9>": 172,
"<0xAA>": 173,
"<0xAB>": 174,
"<0xAC>": 175,
"<0xAD>": 176,
"<0xAE>": 177,
"<0xAF>": 178,
"<0xB0>": 179,
"<0xB1>": 180,
"<0xB2>": 181,
"<0xB3>": 182,
"<0xB4>": 183,
"<0xB5>": 184,
"<0xB6>": 185,
"<0xB7>": 186,
"<0xB8>": 187,
"<0xB9>": 188,
"<0xBA>": 189,
"<0xBB>": 190,
"<0xBC>": 191,
"<0xBD>": 192,
"<0xBE>": 193,
"<0xBF>": 194,
"<0xC0>": 195,
"<0xC1>": 196,
"<0xC2>": 197,
"<0xC3>": 198,
"<0xC4>": 199,
"<0xC5>": 200,
"<0xC6>": 201,
"<0xC7>": 202,
"<0xC8>": 203,
"<0xC9>": 204,
"<0xCA>": 205,
"<0xCB>": 206,
"<0xCC>": 207,
"<0xCD>": 208,
"<0xCE>": 209,
"<0xCF>": 210,
"<0xD0>": 211,
"<0xD1>": 212,
"<0xD2>": 213,
"<0xD3>": 214,
"<0xD4>": 215,
"<0xD5>": 216,
"<0xD6>": 217,
"<0xD7>": 218,
"<0xD8>": 219,
"<0xD9>": 220,
"<0xDA>": 221,
"<0xDB>": 222,
"<0xDC>": 223,
"<0xDD>": 224,
"<0xDE>": 225,
"<0xDF>": 226,
"<0xE0>": 227,
"<0xE1>": 228,
"<0xE2>": 229,
"<0xE3>": 230,
"<0xE4>": 231,
"<0xE5>": 232,
"<0xE6>": 233,
"<0xE7>": 234,
"<0xE8>": 235,
"<0xE9>": 236,
"<0xEA>": 237,
"<0xEB>": 238,
"<0xEC>": 239,
"<0xED>": 240,
"<0xEE>": 241,
"<0xEF>": 242,
"<0xF0>": 243,
"<0xF1>": 244,
"<0xF2>": 245,
"<0xF3>": 246,
"<0xF4>": 247,
"<0xF5>": 248,
"<0xF6>": 249,
"<0xF7>": 250,
"<0xF8>": 251,
"<0xF9>": 252,
"<0xFA>": 253,
"<0xFB>": 254,
"<0xFC>": 255,
"<0xFD>": 256,
"<0xFE>": 257,
"<0xFF>": 258,
"ββ": 259,
"βt": 260,
"er": 261,
"in": 262,
"βa": 263,
"en": 264,
"on": 265,
"βth": 266,
"es": 267,
"ββββ": 268,
"βs": 269,
"βd": 270,
"at": 271,
"or": 272,
"an": 273,
"βc": 274,
"is": 275,
"re": 276,
"it": 277,
"βthe": 278,
"ar": 279,
"le": 280,
"βw": 281,
"βp": 282,
"ou": 283,
"al": 284,
"βf": 285,
"βm": 286,
"ed": 287,
"βo": 288,
"βb": 289,
"om": 290,
"ion": 291,
"ing": 292,
"ic": 293,
"as": 294,
"el": 295,
"ent": 296,
"βin": 297,
"βh": 298,
"nd": 299,
"et": 300,
"βl": 301,
"βn": 302,
"st": 303,
"βto": 304,
"ch": 305,
"βI": 306,
"ro": 307,
"ββββββββ": 308,
"il": 309,
"βof": 310,
"de": 311,
"ct": 312,
"β(": 313,
"am": 314,
"βC": 315,
"βde": 316,
"βS": 317,
"βu": 318,
"βA": 319,
"β\\": 320,
"βe": 321,
"βand": 322,
"βT": 323,
"ol": 324,
"βv": 325,
"im": 326,
"ot": 327,
"ad": 328,
"ut": 329,
"βg": 330,
"em": 331,
"ur": 332,
"id": 333,
"β*": 334,
"ig": 335,
"ra": 336,
"βre": 337,
"βis": 338,
"qu": 339,
"ow": 340,
"βM": 341,
"est": 342,
"βy": 343,
"se": 344,
"ve": 345,
"ce": 346,
"ie": 347,
"un": 348,
"βP": 349,
"βB": 350,
"ag": 351,
"ul": 352,
"β=": 353,
"he": 354,
"end": 355,
"ode": 356,
"ter": 357,
"ment": 358,
"os": 359,
"βD": 360,
"if": 361,
"ation": 362,
"βfor": 363,
"βr": 364,
"βL": 365,
"βyou": 366,
"βbe": 367,
"ly": 368,
"ver": 369,
"ab": 370,
"te": 371,
"βit": 372,
"βon": 373,
"ri": 374,
"us": 375,
"β\"": 376,
"βwh": 377,
"βcon": 378,
"βH": 379,
"βst": 380,
"ir": 381,
"βE": 382,
"βF": 383,
"ck": 384,
"βan": 385,
"th": 386,
"eg": 387,
"ay": 388,
"ith": 389,
"βR": 390,
"ist": 391,
"and": 392,
"βthat": 393,
"βal": 394,
"β$": 395,
"β#": 396,
"od": 397,
"um": 398,
"βW": 399,
"ht": 400,
"code": 401,
"βG": 402,
"ate": 403,
"ess": 404,
"βN": 405,
"ere": 406,
"pp": 407,
"βas": 408,
"βse": 409,
"βpro": 410,
"βwith": 411,
"pe": 412,
"βk": 413,
"ers": 414,
"pt": 415,
");": 416,
"lo": 417,
"βββββ": 418,
"βcom": 419,
"ame": 420,
"β`": 421,
"βCom": 422,
"ia": 423,
"ant": 424,
"βla": 425,
"β{": 426,
"βen": 427,
"ction": 428,
"βex": 429,
"ld": 430,
"ub": 431,
"βj": 432,
"la": 433,
"ue": 434,
"βJ": 435,
"ich": 436,
"βdo": 437,
"βO": 438,
"βqu": 439,
"iv": 440,
"ort": 441,
"art": 442,
"βun": 443,
"β##": 444,
"βthis": 445,
"ke": 446,
"βha": 447,
"β-": 448,
"out": 449,
"βThe": 450,
"βnot": 451,
"βne": 452,
"ill": 453,
"βle": 454,
"ci": 455,
"rom": 456,
"ine": 457,
"//": 458,
"op": 459,
"egin": 460,
"βComment": 461,
"ββββββββββββββββ": 462,
"begin": 463,
"ΡΡ": 464,
"ass": 465,
"iz": 466,
").": 467,
"og": 468,
"βΠΏ": 469,
"βor": 470,
"βwas": 471,
"βat": 472,
"our": 473,
"βi": 474,
"ain": 475,
"βK": 476,
"Π½Π°": 477,
"βV": 478,
"ge": 479,
"βsu": 480,
"ap": 481,
"age": 482,
"ould": 483,
"ne": 484,
"av": 485,
"xt": 486,
"ore": 487,
"ile": 488,
"--": 489,
"βΠ²": 490,
"βby": 491,
"li": 492,
"ath": 493,
"ΡΠ°": 494,
"ber": 495,
"ach": 496,
"all": 497,
"βTh": 498,
"ult": 499,
"β": 500
},
"merges": [
[
"β",
"th"
],
[
"βt",
"he"
],
[
"β",
"in"
],
[
"β",
"de"
],
[
"βa",
"nd"
],
[
"β",
"and"
],
[
"β",
"re"
],
[
"β",
"is"
],
[
"at",
"ion"
],
[
"βf",
"or"
],
[
"βy",
"ou"
],
[
"β",
"it"
],
[
"β",
"on"
],
[
"βc",
"on"
],
[
"β",
"st"
],
[
"β",
"an"
],
[
"βth",
"at"
],
[
"β",
"al"
],
[
"β",
"as"
],
[
"β",
"se"
],
[
"βp",
"ro"
],
[
"βw",
"ith"
],
[
"βc",
"om"
],
[
"βC",
"om"
],
[
"β",
"la"
],
[
"β",
"en"
],
[
"ct",
"ion"
],
[
"β",
"qu"
],
[
"β",
"un"
],
[
"βth",
"is"
],
[
"βT",
"he"
],
[
"βn",
"ot"
],
[
"β",
"ne"
],
[
"β",
"le"
],
[
"eg",
"in"
],
[
"βCom",
"ment"
],
[
"β",
"or"
],
[
"βw",
"as"
],
[
"β",
"at"
],
[
"ou",
"ld"
],
[
"β",
"β"
],
[
"ββ",
"ββ"
],
[
"ββββ",
"ββββ"
],
[
"ββββ",
"β"
],
[
"β",
"ββββ"
],
[
"ββββββββ",
"ββββββββ"
]
]
}
}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364{
"add_bos_token": true,
"add_eos_token": false,
"add_prefix_space": null,
"added_tokens_decoder": {
"0": {
"content": "<unk>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"1": {
"content": "<s>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"2": {
"content": "</s>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"501": {
"content": "<image>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"502": {
"content": "<pad>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
}
},
"bos_token": "<s>",
"clean_up_tokenization_spaces": false,
"eos_token": "</s>",
"extra_special_tokens": {
"image_token": "<image>"
},
"image_token": "<image>",
"legacy": false,
"model_max_length": 1000000000000000019884624838656,
"pad_token": "<pad>",
"padding_side": "left",
"processor_class": "LlavaProcessor",
"sp_model_kwargs": {},
"tokenizer_class": "LlamaTokenizer",
"trust_remote_code": false,
"unk_token": "<unk>",
"use_default_system_prompt": false
}chat_template.jinjaAdded+2
chat_template.jsonAdded+3
config.jsonAdded+38
generation_config.jsonAdded+7
preprocessor_config.jsonAdded+28
processor_config.jsonAdded+7
tokenizer.jsonAdded+846
tokenizer_config.jsonAdded+64