hf-transformers-bot commited on
Commit
baa55fd
·
verified ·
1 Parent(s): c4a5c2e

Update tiny models for Phi4MultimodalForCausalLM

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 @@
 
 
1
+ {% for message in messages %}{{ '<|' + message['role'] + '|>' }}{% if message['content'] is string %}{{ message['content'] }}{% else %}{% for content in message['content'] %}{% if content['type'] == 'image' %}{{ '<|image|>' }}{% elif content['type'] == 'audio' %}{{ '<|audio|>' }}{% elif content['type'] == 'text' %}{{ content['text'] }}{% endif %}{% endfor %}{% endif %}{% if message['role'] == 'system' and 'tools' in message and message['tools'] is not none %}{{ '<|tool|>' + message['tools'] + '<|/tool|>' + '<|end|>' }}{% endif %}{{ '<|end|>' }}{% endfor %}{% if add_generation_prompt %}{{ '<|assistant|>' }}{% else %}{{ eos_token }}{% endif %}
config.json ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Phi4MultimodalForCausalLM"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "audio_config": {
7
+ "activation": "swish",
8
+ "audio_token_id": 200011,
9
+ "bias_max_distance": 1000,
10
+ "bias_symmetric": false,
11
+ "chunk_size": -1,
12
+ "conv_activation": "swish",
13
+ "conv_glu_type": "swish",
14
+ "depthwise_multiplier": 1,
15
+ "depthwise_separable_out_channel": 128,
16
+ "downsample_rate": 1,
17
+ "dropout_rate": 0.0,
18
+ "ext_pw_out_channel": 1024,
19
+ "feature_layer": -2,
20
+ "hidden_size": 32,
21
+ "initializer_range": 1e-05,
22
+ "input_size": 80,
23
+ "intermediate_size": 48,
24
+ "kernel_size": 3,
25
+ "left_chunk": 18,
26
+ "model_type": "phi4_multimodal_audio",
27
+ "nemo_activation": "relu",
28
+ "nemo_conv_channels": 128,
29
+ "nemo_final_size": 10,
30
+ "num_attention_heads": 8,
31
+ "num_blocks": 2,
32
+ "time_reduction": 8
33
+ },
34
+ "bos_token_id": 199999,
35
+ "dtype": "float32",
36
+ "embd_pdrop": 0.0,
37
+ "eos_token_id": 199999,
38
+ "hidden_act": "silu",
39
+ "hidden_size": 32,
40
+ "initializer_range": 0.02,
41
+ "intermediate_size": 64,
42
+ "is_decoder": true,
43
+ "max_position_embeddings": 4096,
44
+ "model_type": "phi4_multimodal",
45
+ "num_attention_heads": 4,
46
+ "num_hidden_layers": 2,
47
+ "num_key_value_heads": 2,
48
+ "original_max_position_embeddings": 4096,
49
+ "pad_token_id": 199999,
50
+ "resid_pdrop": 0.0,
51
+ "rms_norm_eps": 1e-05,
52
+ "rope_parameters": {
53
+ "partial_rotary_factor": 1.0,
54
+ "rope_theta": 10000.0,
55
+ "rope_type": "default"
56
+ },
57
+ "sliding_window": null,
58
+ "tie_word_embeddings": false,
59
+ "transformers_version": "5.16.0.dev0",
60
+ "use_cache": true,
61
+ "vision_config": {
62
+ "attention_dropout": 0.0,
63
+ "crop_size": 16,
64
+ "feature_layer": -2,
65
+ "hidden_act": "gelu_pytorch_tanh",
66
+ "hidden_size": 32,
67
+ "image_size": 448,
68
+ "image_token_id": 200010,
69
+ "initializer_range": 1e-05,
70
+ "intermediate_size": 64,
71
+ "layer_norm_eps": 1e-06,
72
+ "model_type": "phi4_multimodal_vision",
73
+ "num_attention_heads": 8,
74
+ "num_channels": 3,
75
+ "num_hidden_layers": 2,
76
+ "patch_size": 14
77
+ },
78
+ "vocab_size": 200029
79
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 199999,
4
+ "eos_token_id": 199999,
5
+ "output_attentions": false,
6
+ "output_hidden_states": false,
7
+ "pad_token_id": 199999,
8
+ "transformers_version": "5.16.0.dev0",
9
+ "use_cache": true
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4504f46a12431375b7f39f04fc0468a12a86d4420a6a6f998cbfa710e508f4df
3
+ size 52990704
preprocessor_config.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "audio_compression_rate": 8,
3
+ "audio_downsample_rate": 1,
4
+ "audio_feat_stride": 1,
5
+ "crop_size": 448,
6
+ "feature_extractor_type": "Phi4MultimodalFeatureExtractor",
7
+ "feature_size": 80,
8
+ "hop_length": 160,
9
+ "n_fft": 512,
10
+ "padding_side": "right",
11
+ "padding_value": 0.0,
12
+ "preemphasis": 0.97,
13
+ "return_attention_mask": true,
14
+ "sampling_rate": 16000,
15
+ "size": 448,
16
+ "win_length": 400
17
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aee2ac83f75c7dac7885cebefd51bbc73c6ca8176b568b9bc09383a5d7364678
3
+ size 15524288
tokenizer_config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "audio_token": "<|audio|>",
4
+ "backend": "tokenizers",
5
+ "bos_token": "<|endoftext|>",
6
+ "clean_up_tokenization_spaces": false,
7
+ "eos_token": "<|endoftext|>",
8
+ "errors": "replace",
9
+ "image_token": "<|image|>",
10
+ "is_local": true,
11
+ "local_files_only": false,
12
+ "model_max_length": 4096,
13
+ "model_specific_special_tokens": {
14
+ "audio_token": "<|audio|>",
15
+ "image_token": "<|image|>"
16
+ },
17
+ "pad_token": "<|endoftext|>",
18
+ "processor_class": "Phi4MultimodalProcessor",
19
+ "tokenizer_class": "GPT2Tokenizer",
20
+ "unk_token": "<|endoftext|>"
21
+ }