hf-transformers-bot commited on
Commit
cb4b336
·
verified ·
1 Parent(s): d6693c2

Update tiny models for Cohere2VisionModel

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,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{- "<|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.
3
+
4
+ Your information cutoff date is June 2024.
5
+
6
+ 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 but have the ability to speak many more languages.
7
+
8
+ # Default Preamble
9
+ The following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.
10
+ - Your name is Command.
11
+ - You are a large language model built by Cohere.
12
+ - You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.
13
+ - If the input is ambiguous, ask clarifying follow-up questions.
14
+ - Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).
15
+ - Use LaTeX to generate mathematical notation for complex equations.
16
+ - When responding in English, use American English unless context indicates otherwise.
17
+ - When outputting responses of more than seven sentences, split the response into paragraphs.
18
+ - Prefer the active voice.
19
+ - 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.
20
+ - Use gender-neutral pronouns for unspecified persons.
21
+ - Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.
22
+ - Use the third person when asked to write a summary.
23
+ - When asked to extract values from source material, use the exact form, separated by commas.
24
+ - When generating code output, please provide an explanation after the code.
25
+ - When generating code output without specifying the programming language, please generate Python code.
26
+ - If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.<|END_OF_TURN_TOKEN|>" -}}
27
+ {%- for message in messages -%}
28
+ <|START_OF_TURN_TOKEN|>{{ message.role | replace("user", "<|USER_TOKEN|>") | replace("assistant", "<|CHATBOT_TOKEN|><|START_RESPONSE|>") | replace("system", "<|SYSTEM_TOKEN|>") }}
29
+ {%- if message.content is defined -%}
30
+ {%- if message.content is string -%}
31
+ {{ message.content }}
32
+ {%- else -%}
33
+ {%- for item in message.content -%}
34
+ {%- if item.type == 'image' -%}
35
+ <|IMG_PATCH|>
36
+ {%- elif item.type == 'text' -%}
37
+ {{ item.text }}
38
+ {%- endif -%}
39
+ {%- endfor -%}
40
+ {%- endif -%}
41
+ {%- elif message.message is defined -%}
42
+ {%- if message.message is string -%}
43
+ {{ message.message }}
44
+ {%- else -%}
45
+ {%- for item in message.message -%}
46
+ {%- if item.type == 'image' -%}
47
+ <|IMG_PATCH|>
48
+ {%- elif item.type == 'text' -%}
49
+ {{ item.text }}
50
+ {%- endif -%}
51
+ {%- endfor -%}
52
+ {%- endif -%}
53
+ {%- endif -%}
54
+ {%- if message.role == "assistant" -%}
55
+ <|END_RESPONSE|>
56
+ {%- endif -%}
57
+ <|END_OF_TURN_TOKEN|>
58
+ {%- endfor -%}
59
+ {%- if add_generation_prompt -%}
60
+ <|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
61
+ {%- endif -%}
config.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alignment_intermediate_size": 32,
3
+ "architectures": [
4
+ "Cohere2VisionModel"
5
+ ],
6
+ "downsample_factor": 2,
7
+ "dtype": "float32",
8
+ "image_token_id": 2,
9
+ "model_type": "cohere2_vision",
10
+ "text_config": {
11
+ "attention_bias": false,
12
+ "attention_dropout": 0.0,
13
+ "bos_token_id": 5,
14
+ "eos_token_id": 255001,
15
+ "head_dim": 32,
16
+ "hidden_act": "silu",
17
+ "hidden_size": 128,
18
+ "initializer_range": 0.02,
19
+ "intermediate_size": 37,
20
+ "layer_norm_eps": 1e-05,
21
+ "layer_types": [
22
+ "sliding_attention",
23
+ "sliding_attention"
24
+ ],
25
+ "logit_scale": 0.0625,
26
+ "max_position_embeddings": 512,
27
+ "model_type": "cohere2",
28
+ "num_attention_heads": 4,
29
+ "num_hidden_layers": 2,
30
+ "num_key_value_heads": 4,
31
+ "output_channels": 64,
32
+ "pad_token_id": 0,
33
+ "rope_parameters": {
34
+ "rope_theta": 10000.0,
35
+ "rope_type": "default"
36
+ },
37
+ "sliding_window": 4096,
38
+ "tie_word_embeddings": true,
39
+ "use_cache": true,
40
+ "vocab_size": 255037
41
+ },
42
+ "tie_word_embeddings": true,
43
+ "transformers_version": "5.16.0.dev0",
44
+ "vision_config": {
45
+ "attention_dropout": 0.0,
46
+ "hidden_act": "gelu_pytorch_tanh",
47
+ "hidden_size": 32,
48
+ "image_size": 64,
49
+ "intermediate_size": 128,
50
+ "layer_norm_eps": 1e-06,
51
+ "model_type": "siglip_vision_model",
52
+ "num_attention_heads": 4,
53
+ "num_channels": 3,
54
+ "num_hidden_layers": 2,
55
+ "patch_size": 8,
56
+ "vision_use_head": false
57
+ }
58
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a9e0ed64cddd52f99e445140e7a04758c26d6bedbd4033cafdb8e3fd5df48460
3
+ size 131385368
preprocessor_config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": {
3
+ "height": 64,
4
+ "width": 64
5
+ },
6
+ "crop_to_patches": true,
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": "Cohere2VisionImageProcessor",
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:19f07b55c847fe3eecf394d1c625bb6e93009b25da590cb3ffbadc78dd45bd1f
3
+ size 20125687
tokenizer_config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "boi_token": "<|START_OF_IMG|>",
5
+ "bos_token": "<BOS_TOKEN>",
6
+ "clean_up_tokenization_spaces": false,
7
+ "cls_token": "<CLS>",
8
+ "eoi_token": "<|END_OF_IMG|>",
9
+ "eos_token": "<|END_OF_TURN_TOKEN|>",
10
+ "errors": "replace",
11
+ "image_token": "<|IMG_PATCH|>",
12
+ "img_line_break_token": "<|IMG_LINE_BREAK|>",
13
+ "is_local": true,
14
+ "legacy": true,
15
+ "local_files_only": false,
16
+ "mask_token": "<MASK_TOKEN>",
17
+ "model_max_length": 1000000000000000019884624838656,
18
+ "model_specific_special_tokens": {
19
+ "boi_token": "<|START_OF_IMG|>",
20
+ "eoi_token": "<|END_OF_IMG|>",
21
+ "image_token": "<|IMG_PATCH|>",
22
+ "img_line_break_token": "<|IMG_LINE_BREAK|>"
23
+ },
24
+ "pad_token": "<PAD>",
25
+ "processor_class": "Cohere2VisionProcessor",
26
+ "sep_token": "<SEP>",
27
+ "sp_model_kwargs": {},
28
+ "spaces_between_special_tokens": false,
29
+ "tokenizer_class": "CohereTokenizer",
30
+ "unk_token": "<UNK>",
31
+ "use_default_system_prompt": false
32
+ }