Add Cosmos3 Edge processor test fixture
Browse files- chat_template.jinja +1 -0
- processor_config.json +59 -0
- tokenizer.json +134 -0
- tokenizer_config.json +16 -0
chat_template.jinja
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{% for message in messages %}{{ message['role'] + ': ' }}{% for content in message['content'] %}{% if content['type'] == 'image' %}<|vision_start|><|image_pad|><|vision_end|>{% elif content['type'] == 'video' %}<|vision_start|><|video_pad|><|vision_end|>{% elif content['type'] == 'text' %}{{ content['text'] }}{% endif %}{% endfor %}{% endfor %}{% if add_generation_prompt %}{{ 'assistant: ' }}{% endif %}
|
processor_config.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_processor": {
|
| 3 |
+
"do_convert_rgb": true,
|
| 4 |
+
"do_normalize": true,
|
| 5 |
+
"do_rescale": true,
|
| 6 |
+
"do_resize": true,
|
| 7 |
+
"image_mean": [
|
| 8 |
+
0.5,
|
| 9 |
+
0.5,
|
| 10 |
+
0.5
|
| 11 |
+
],
|
| 12 |
+
"image_processor_type": "Cosmos3EdgeImageProcessor",
|
| 13 |
+
"image_std": [
|
| 14 |
+
0.5,
|
| 15 |
+
0.5,
|
| 16 |
+
0.5
|
| 17 |
+
],
|
| 18 |
+
"merge_size": 2,
|
| 19 |
+
"patch_size": 16,
|
| 20 |
+
"resample": 3,
|
| 21 |
+
"rescale_factor": 0.00392156862745098,
|
| 22 |
+
"size": {
|
| 23 |
+
"longest_edge": 9216,
|
| 24 |
+
"shortest_edge": 1024
|
| 25 |
+
}
|
| 26 |
+
},
|
| 27 |
+
"processor_class": "Cosmos3EdgeProcessor",
|
| 28 |
+
"video_processor": {
|
| 29 |
+
"do_convert_rgb": true,
|
| 30 |
+
"do_normalize": true,
|
| 31 |
+
"do_rescale": true,
|
| 32 |
+
"do_resize": true,
|
| 33 |
+
"do_sample_frames": false,
|
| 34 |
+
"fps": 2,
|
| 35 |
+
"image_mean": [
|
| 36 |
+
0.5,
|
| 37 |
+
0.5,
|
| 38 |
+
0.5
|
| 39 |
+
],
|
| 40 |
+
"image_std": [
|
| 41 |
+
0.5,
|
| 42 |
+
0.5,
|
| 43 |
+
0.5
|
| 44 |
+
],
|
| 45 |
+
"max_frames": 768,
|
| 46 |
+
"merge_size": 2,
|
| 47 |
+
"min_frames": 4,
|
| 48 |
+
"patch_size": 16,
|
| 49 |
+
"resample": 3,
|
| 50 |
+
"rescale_factor": 0.00392156862745098,
|
| 51 |
+
"return_metadata": true,
|
| 52 |
+
"size": {
|
| 53 |
+
"longest_edge": 73728,
|
| 54 |
+
"shortest_edge": 1024
|
| 55 |
+
},
|
| 56 |
+
"temporal_patch_size": 1,
|
| 57 |
+
"video_processor_type": "Cosmos3EdgeVideoProcessor"
|
| 58 |
+
}
|
| 59 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": "1.0",
|
| 3 |
+
"truncation": null,
|
| 4 |
+
"padding": null,
|
| 5 |
+
"added_tokens": [
|
| 6 |
+
{
|
| 7 |
+
"id": 0,
|
| 8 |
+
"content": "<unk>",
|
| 9 |
+
"single_word": false,
|
| 10 |
+
"lstrip": false,
|
| 11 |
+
"rstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"special": true
|
| 14 |
+
},
|
| 15 |
+
{
|
| 16 |
+
"id": 1,
|
| 17 |
+
"content": "<pad>",
|
| 18 |
+
"single_word": false,
|
| 19 |
+
"lstrip": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"normalized": false,
|
| 22 |
+
"special": true
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"id": 2,
|
| 26 |
+
"content": "<bos>",
|
| 27 |
+
"single_word": false,
|
| 28 |
+
"lstrip": false,
|
| 29 |
+
"rstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"special": true
|
| 32 |
+
},
|
| 33 |
+
{
|
| 34 |
+
"id": 3,
|
| 35 |
+
"content": "<eos>",
|
| 36 |
+
"single_word": false,
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"rstrip": false,
|
| 39 |
+
"normalized": false,
|
| 40 |
+
"special": true
|
| 41 |
+
},
|
| 42 |
+
{
|
| 43 |
+
"id": 4,
|
| 44 |
+
"content": "<|vision_start|>",
|
| 45 |
+
"single_word": false,
|
| 46 |
+
"lstrip": false,
|
| 47 |
+
"rstrip": false,
|
| 48 |
+
"normalized": false,
|
| 49 |
+
"special": true
|
| 50 |
+
},
|
| 51 |
+
{
|
| 52 |
+
"id": 5,
|
| 53 |
+
"content": "<|vision_end|>",
|
| 54 |
+
"single_word": false,
|
| 55 |
+
"lstrip": false,
|
| 56 |
+
"rstrip": false,
|
| 57 |
+
"normalized": false,
|
| 58 |
+
"special": true
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"id": 6,
|
| 62 |
+
"content": "<|image_pad|>",
|
| 63 |
+
"single_word": false,
|
| 64 |
+
"lstrip": false,
|
| 65 |
+
"rstrip": false,
|
| 66 |
+
"normalized": false,
|
| 67 |
+
"special": true
|
| 68 |
+
},
|
| 69 |
+
{
|
| 70 |
+
"id": 7,
|
| 71 |
+
"content": "<|video_pad|>",
|
| 72 |
+
"single_word": false,
|
| 73 |
+
"lstrip": false,
|
| 74 |
+
"rstrip": false,
|
| 75 |
+
"normalized": false,
|
| 76 |
+
"special": true
|
| 77 |
+
}
|
| 78 |
+
],
|
| 79 |
+
"normalizer": null,
|
| 80 |
+
"pre_tokenizer": {
|
| 81 |
+
"type": "Whitespace"
|
| 82 |
+
},
|
| 83 |
+
"post_processor": {
|
| 84 |
+
"type": "TemplateProcessing",
|
| 85 |
+
"single": [
|
| 86 |
+
{
|
| 87 |
+
"Sequence": {
|
| 88 |
+
"id": "A",
|
| 89 |
+
"type_id": 0
|
| 90 |
+
}
|
| 91 |
+
}
|
| 92 |
+
],
|
| 93 |
+
"pair": [
|
| 94 |
+
{
|
| 95 |
+
"Sequence": {
|
| 96 |
+
"id": "A",
|
| 97 |
+
"type_id": 0
|
| 98 |
+
}
|
| 99 |
+
},
|
| 100 |
+
{
|
| 101 |
+
"Sequence": {
|
| 102 |
+
"id": "B",
|
| 103 |
+
"type_id": 1
|
| 104 |
+
}
|
| 105 |
+
}
|
| 106 |
+
],
|
| 107 |
+
"special_tokens": {}
|
| 108 |
+
},
|
| 109 |
+
"decoder": null,
|
| 110 |
+
"model": {
|
| 111 |
+
"type": "WordLevel",
|
| 112 |
+
"vocab": {
|
| 113 |
+
"<unk>": 0,
|
| 114 |
+
"<pad>": 1,
|
| 115 |
+
"<bos>": 2,
|
| 116 |
+
"<eos>": 3,
|
| 117 |
+
"<|vision_start|>": 4,
|
| 118 |
+
"<|vision_end|>": 5,
|
| 119 |
+
"<|image_pad|>": 6,
|
| 120 |
+
"<|video_pad|>": 7,
|
| 121 |
+
"lower": 8,
|
| 122 |
+
"newer": 9,
|
| 123 |
+
"upper": 10,
|
| 124 |
+
"older": 11,
|
| 125 |
+
"longer": 12,
|
| 126 |
+
"string": 13,
|
| 127 |
+
"Describe": 14,
|
| 128 |
+
"this": 15,
|
| 129 |
+
"user": 16,
|
| 130 |
+
"assistant": 17
|
| 131 |
+
},
|
| 132 |
+
"unk_token": "<unk>"
|
| 133 |
+
}
|
| 134 |
+
}
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<bos>",
|
| 4 |
+
"eos_token": "<eos>",
|
| 5 |
+
"extra_special_tokens": [],
|
| 6 |
+
"image_token": "<|image_pad|>",
|
| 7 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 8 |
+
"pad_token": "<pad>",
|
| 9 |
+
"processor_class": "Cosmos3EdgeProcessor",
|
| 10 |
+
"return_mm_token_type_ids": true,
|
| 11 |
+
"tokenizer_class": "TokenizersBackend",
|
| 12 |
+
"unk_token": "<unk>",
|
| 13 |
+
"video_token": "<|video_pad|>",
|
| 14 |
+
"vision_end_token": "<|vision_end|>",
|
| 15 |
+
"vision_start_token": "<|vision_start|>"
|
| 16 |
+
}
|