hf-transformers-bot commited on
Commit
0cd2379
·
verified ·
1 Parent(s): 5c63048

Update tiny models for AyaVisionModel

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
chat_template.jinja ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{ bos_token }}<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble
2
+ You are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes. When analyzing images, carefully describe and interpret their content while avoiding any promotion of harm, misinformation, or bias.
3
+
4
+ You are Aya Vision, a vision-language model built by Cohere for AI. You have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew. You are capable of interpreting images, including describing them, answering questions about their contents, extracting textual information, and analyzing visual context. Your responses must maintain the highest standards of quality, accuracy, and safety.
5
+
6
+ # Default Preamble
7
+ The following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.
8
+ - Your name is Aya Vision.
9
+ - You are a large language model built by Cohere for AI.
10
+ - You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.
11
+ - If the input is ambiguous, ask clarifying follow-up questions.
12
+ - Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).
13
+ - Use LaTeX to generate mathematical notation for complex equations.
14
+ - When responding in English, use American English unless context indicates otherwise.
15
+ - When outputting responses of more than seven sentences, split the response into paragraphs.
16
+ - Prefer the active voice.
17
+ - Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.
18
+ - Use gender-neutral pronouns for unspecified persons.
19
+ - Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.
20
+ - Use the third person when asked to write a summary.
21
+ - When asked to extract values from source material, use the exact form, separated by commas.
22
+ - When generating code output, please provide an explanation after the code.
23
+ - When generating code output without specifying the programming language, please generate Python code.
24
+ - If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.
25
+ <|END_OF_TURN_TOKEN|>
26
+ {%- for message in messages -%}
27
+ <|START_OF_TURN_TOKEN|>{{ message.role | replace("user", "<|USER_TOKEN|>") | replace("assistant", "<|CHATBOT_TOKEN|><|START_RESPONSE|>") | replace("system", "<|SYSTEM_TOKEN|>") }}
28
+ {%- if message.content is defined -%}
29
+ {%- if message.content is string -%}
30
+ {{ message.content }}
31
+ {%- else -%}
32
+ {%- for item in message.content | selectattr('type', 'equalto', 'image') -%}
33
+ <image>
34
+ {%- endfor -%}
35
+ {%- for item in message.content | selectattr('type', 'equalto', 'text') -%}
36
+ {{ item.text }}
37
+ {%- endfor -%}
38
+ {%- endif -%}
39
+ {%- elif message.message is defined -%}
40
+ {%- if message.message is string -%}
41
+ {{ message.message }}
42
+ {%- else -%}
43
+ {%- for item in message.message | selectattr('type', 'equalto', 'image') -%}
44
+ <image>
45
+ {%- endfor -%}
46
+ {%- for item in message.message | selectattr('type', 'equalto', 'text') -%}
47
+ {{ item.text }}
48
+ {%- endfor -%}
49
+ {%- endif -%}
50
+ {%- endif -%}
51
+ {%- if message.role == "assistant" -%}
52
+ <|END_RESPONSE|>
53
+ {%- endif -%}
54
+ <|END_OF_TURN_TOKEN|>
55
+ {%- endfor -%}
56
+ {%- if add_generation_prompt -%}
57
+ <|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
58
+ {%- endif -%}
config.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "adapter_layer_norm_eps": 1e-06,
3
+ "architectures": [
4
+ "AyaVisionModel"
5
+ ],
6
+ "bos_token_id": 5,
7
+ "downsample_factor": 2,
8
+ "dtype": "float32",
9
+ "eos_token_id": 255001,
10
+ "image_token_index": 2,
11
+ "model_type": "aya_vision",
12
+ "pad_token_id": 0,
13
+ "text_config": {
14
+ "attention_bias": false,
15
+ "attention_dropout": 0.0,
16
+ "bos_token_id": 5,
17
+ "eos_token_id": 255001,
18
+ "head_dim": 32,
19
+ "hidden_act": "silu",
20
+ "hidden_size": 128,
21
+ "initializer_range": 0.02,
22
+ "intermediate_size": 37,
23
+ "layer_norm_eps": 1e-05,
24
+ "layer_types": [
25
+ "sliding_attention",
26
+ "sliding_attention"
27
+ ],
28
+ "logit_scale": 0.0625,
29
+ "max_position_embeddings": 512,
30
+ "model_type": "cohere2",
31
+ "num_attention_heads": 4,
32
+ "num_hidden_layers": 2,
33
+ "num_key_value_heads": 4,
34
+ "output_channels": 64,
35
+ "pad_token_id": 0,
36
+ "rope_parameters": {
37
+ "rope_theta": 10000.0,
38
+ "rope_type": "default"
39
+ },
40
+ "sliding_window": 4096,
41
+ "tie_word_embeddings": true,
42
+ "use_cache": true,
43
+ "vocab_size": 255037
44
+ },
45
+ "tie_word_embeddings": true,
46
+ "transformers_version": "5.16.0.dev0",
47
+ "vision_config": {
48
+ "attention_dropout": 0.0,
49
+ "hidden_act": "gelu_pytorch_tanh",
50
+ "hidden_size": 32,
51
+ "image_size": 64,
52
+ "intermediate_size": 128,
53
+ "layer_norm_eps": 1e-06,
54
+ "model_type": "siglip_vision_model",
55
+ "num_attention_heads": 4,
56
+ "num_channels": 3,
57
+ "num_hidden_layers": 2,
58
+ "patch_size": 8,
59
+ "vision_use_head": false
60
+ },
61
+ "vision_feature_layer": -1,
62
+ "vision_feature_select_strategy": "full"
63
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db0f4eb4157d534e209f76c940d0075bc8834caacf987c35bdea032fb829c6b5
3
+ size 131460832
preprocessor_config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": {
3
+ "height": 64,
4
+ "width": 64
5
+ },
6
+ "crop_to_patches": false,
7
+ "do_convert_rgb": true,
8
+ "do_normalize": true,
9
+ "do_rescale": true,
10
+ "do_resize": true,
11
+ "image_mean": [
12
+ 0.48145466,
13
+ 0.4578275,
14
+ 0.40821073
15
+ ],
16
+ "image_processor_type": "GotOcr2ImageProcessor",
17
+ "image_std": [
18
+ 0.26862954,
19
+ 0.26130258,
20
+ 0.27577711
21
+ ],
22
+ "max_patches": 12,
23
+ "min_patches": 1,
24
+ "resample": 3,
25
+ "rescale_factor": 0.00392156862745098,
26
+ "size": {
27
+ "height": 64,
28
+ "width": 64
29
+ }
30
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:00fd50e20f3646e864557a7d1b1eb7ee6324a837f71d985e58f81fa976fef471
3
+ size 20125845
tokenizer_config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<BOS_TOKEN>",
5
+ "clean_up_tokenization_spaces": false,
6
+ "cls_token": "<CLS>",
7
+ "eos_token": "<|END_OF_TURN_TOKEN|>",
8
+ "errors": "replace",
9
+ "is_local": true,
10
+ "legacy": true,
11
+ "local_files_only": false,
12
+ "mask_token": "<MASK_TOKEN>",
13
+ "max_length": null,
14
+ "model_max_length": 1000000000000000019884624838656,
15
+ "pad_to_multiple_of": null,
16
+ "pad_token": "<PAD>",
17
+ "pad_token_type_id": 0,
18
+ "padding_side": "left",
19
+ "processor_class": "AyaVisionProcessor",
20
+ "sep_token": "<SEP>",
21
+ "sp_model_kwargs": {},
22
+ "spaces_between_special_tokens": false,
23
+ "tokenizer_class": "CohereTokenizer",
24
+ "unk_token": null,
25
+ "use_default_system_prompt": false
26
+ }