bweng commited on
Commit
6598299
·
verified ·
1 Parent(s): ba77faf

Adding stateful 4bit model as well

Browse files
silero_vad_stateful_4bit.mlmodelc/analytics/coremldata.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a6310ac1abb0ec7a06994d0c46e66c34afdf0fa23d88044eeb695e77011fcb0
3
+ size 243
silero_vad_stateful_4bit.mlmodelc/coremldata.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d945f4a9056d9eeebd6abc43d4d977f7a2da55d7fc6bb5993636ebc728fe371b
3
+ size 529
silero_vad_stateful_4bit.mlmodelc/metadata.json ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "shortDescription" : "Stateful LSTM VAD with proper state management for iOS 17+",
4
+ "metadataOutputVersion" : "3.0",
5
+ "outputSchema" : [
6
+ {
7
+ "hasShapeFlexibility" : "0",
8
+ "isOptional" : "0",
9
+ "dataType" : "Float32",
10
+ "formattedType" : "MultiArray (Float32 1)",
11
+ "shortDescription" : "",
12
+ "shape" : "[1]",
13
+ "name" : "vad_probability",
14
+ "type" : "MultiArray"
15
+ },
16
+ {
17
+ "hasShapeFlexibility" : "0",
18
+ "isOptional" : "0",
19
+ "dataType" : "Float32",
20
+ "formattedType" : "MultiArray (Float32 1 × 1 × 128)",
21
+ "shortDescription" : "",
22
+ "shape" : "[1, 1, 128]",
23
+ "name" : "h_state_out",
24
+ "type" : "MultiArray"
25
+ },
26
+ {
27
+ "hasShapeFlexibility" : "0",
28
+ "isOptional" : "0",
29
+ "dataType" : "Float32",
30
+ "formattedType" : "MultiArray (Float32 1 × 1 × 128)",
31
+ "shortDescription" : "",
32
+ "shape" : "[1, 1, 128]",
33
+ "name" : "c_state_out",
34
+ "type" : "MultiArray"
35
+ }
36
+ ],
37
+ "version" : "1.0",
38
+ "modelParameters" : [
39
+
40
+ ],
41
+ "author" : "Clean Stateful VAD Model",
42
+ "specificationVersion" : 8,
43
+ "storagePrecision" : "Mixed (Float16, Palettized (4 bits))",
44
+ "mlProgramOperationTypeHistogram" : {
45
+ "Ios16.sigmoid" : 1,
46
+ "Ios17.squeeze" : 4,
47
+ "Ios17.cast" : 6,
48
+ "Ios17.linear" : 4,
49
+ "Ios17.transpose" : 2,
50
+ "Ios16.relu" : 2,
51
+ "Ios16.constexprLutToDense" : 5,
52
+ "Ios17.lstm" : 1,
53
+ "Ios17.expandDims" : 3
54
+ },
55
+ "computePrecision" : "Mixed (Float16, Float32, Int32)",
56
+ "stateSchema" : [
57
+
58
+ ],
59
+ "isUpdatable" : "0",
60
+ "availability" : {
61
+ "macOS" : "14.0",
62
+ "tvOS" : "17.0",
63
+ "visionOS" : "1.0",
64
+ "watchOS" : "10.0",
65
+ "iOS" : "17.0",
66
+ "macCatalyst" : "17.0"
67
+ },
68
+ "modelType" : {
69
+ "name" : "MLModelType_mlProgram"
70
+ },
71
+ "inputSchema" : [
72
+ {
73
+ "hasShapeFlexibility" : "0",
74
+ "isOptional" : "0",
75
+ "dataType" : "Float32",
76
+ "formattedType" : "MultiArray (Float32 1 × 512)",
77
+ "shortDescription" : "",
78
+ "shape" : "[1, 512]",
79
+ "name" : "audio_chunk",
80
+ "type" : "MultiArray"
81
+ },
82
+ {
83
+ "hasShapeFlexibility" : "0",
84
+ "isOptional" : "0",
85
+ "dataType" : "Float32",
86
+ "formattedType" : "MultiArray (Float32 1 × 1 × 128)",
87
+ "shortDescription" : "",
88
+ "shape" : "[1, 1, 128]",
89
+ "name" : "h_state_in",
90
+ "type" : "MultiArray"
91
+ },
92
+ {
93
+ "hasShapeFlexibility" : "0",
94
+ "isOptional" : "0",
95
+ "dataType" : "Float32",
96
+ "formattedType" : "MultiArray (Float32 1 × 1 × 128)",
97
+ "shortDescription" : "",
98
+ "shape" : "[1, 1, 128]",
99
+ "name" : "c_state_in",
100
+ "type" : "MultiArray"
101
+ }
102
+ ],
103
+ "userDefinedMetadata" : {
104
+ "com.github.apple.coremltools.version" : "8.3.0",
105
+ "com.github.apple.coremltools.source" : "torch==2.5.0",
106
+ "com.github.apple.coremltools.source_dialect" : "TorchScript"
107
+ },
108
+ "generatedClassName" : "silero_vad_stateful_4bit_clean",
109
+ "method" : "predict"
110
+ }
111
+ ]
silero_vad_stateful_4bit.mlmodelc/model.mil ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ program(1.0)
2
+ [buildInfo = dict<tensor<string, []>, tensor<string, []>>({{"coremlc-component-MIL", "3500.14.1"}, {"coremlc-version", "3500.32.1"}})]
3
+ {
4
+ func main<ios17>(tensor<fp32, [1, 512]> audio_chunk, tensor<fp32, [1, 1, 128]> c_state_in, tensor<fp32, [1, 1, 128]> h_state_in) {
5
+ tensor<string, []> audio_chunk_to_fp16_dtype_0 = const()[name = tensor<string, []>("audio_chunk_to_fp16_dtype_0"), val = tensor<string, []>("fp16")];
6
+ tensor<fp16, [128, 512]> encoder_0_weight_to_fp16_palettized = constexpr_lut_to_dense()[indices = tensor<uint8, [32768]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(64))), lut = tensor<fp16, [16]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(32896))), name = tensor<string, []>("encoder_0_weight_to_fp16_palettized"), shape = tensor<uint32, [2]>([128, 512])];
7
+ tensor<fp16, [128]> encoder_0_bias_to_fp16 = const()[name = tensor<string, []>("encoder_0_bias_to_fp16"), val = tensor<fp16, [128]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(33024)))];
8
+ tensor<fp16, [1, 512]> audio_chunk_to_fp16 = cast(dtype = audio_chunk_to_fp16_dtype_0, x = audio_chunk)[name = tensor<string, []>("cast_5")];
9
+ tensor<fp16, [1, 128]> linear_0_cast_fp16 = linear(bias = encoder_0_bias_to_fp16, weight = encoder_0_weight_to_fp16_palettized, x = audio_chunk_to_fp16)[name = tensor<string, []>("linear_0_cast_fp16")];
10
+ tensor<fp16, [1, 128]> input_3_cast_fp16 = relu(x = linear_0_cast_fp16)[name = tensor<string, []>("input_3_cast_fp16")];
11
+ tensor<fp16, [64, 128]> encoder_2_weight_to_fp16_palettized = constexpr_lut_to_dense()[indices = tensor<uint8, [4096]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(33344))), lut = tensor<fp16, [16]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(37504))), name = tensor<string, []>("encoder_2_weight_to_fp16_palettized"), shape = tensor<uint32, [2]>([64, 128])];
12
+ tensor<fp16, [64]> encoder_2_bias_to_fp16 = const()[name = tensor<string, []>("encoder_2_bias_to_fp16"), val = tensor<fp16, [64]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(37632)))];
13
+ tensor<fp16, [1, 64]> linear_1_cast_fp16 = linear(bias = encoder_2_bias_to_fp16, weight = encoder_2_weight_to_fp16_palettized, x = input_3_cast_fp16)[name = tensor<string, []>("linear_1_cast_fp16")];
14
+ tensor<int32, [1]> input_5_axes_0 = const()[name = tensor<string, []>("input_5_axes_0"), val = tensor<int32, [1]>([1])];
15
+ tensor<fp16, [1, 1, 64]> input_5_cast_fp16 = expand_dims(axes = input_5_axes_0, x = linear_1_cast_fp16)[name = tensor<string, []>("input_5_cast_fp16")];
16
+ tensor<string, []> h_state_in_to_fp16_dtype_0 = const()[name = tensor<string, []>("h_state_in_to_fp16_dtype_0"), val = tensor<string, []>("fp16")];
17
+ tensor<string, []> c_state_in_to_fp16_dtype_0 = const()[name = tensor<string, []>("c_state_in_to_fp16_dtype_0"), val = tensor<string, []>("fp16")];
18
+ tensor<int32, [3]> input_5_batch_first_transpose_perm_0 = const()[name = tensor<string, []>("input_5_batch_first_transpose_perm_0"), val = tensor<int32, [3]>([1, 0, 2])];
19
+ tensor<int32, [1]> lstm_out_batch_first_lstm_h0_squeeze_axes_0 = const()[name = tensor<string, []>("lstm_out_batch_first_lstm_h0_squeeze_axes_0"), val = tensor<int32, [1]>([0])];
20
+ tensor<fp16, [1, 1, 128]> h_state_in_to_fp16 = cast(dtype = h_state_in_to_fp16_dtype_0, x = h_state_in)[name = tensor<string, []>("cast_4")];
21
+ tensor<fp16, [1, 128]> lstm_out_batch_first_lstm_h0_squeeze_cast_fp16 = squeeze(axes = lstm_out_batch_first_lstm_h0_squeeze_axes_0, x = h_state_in_to_fp16)[name = tensor<string, []>("lstm_out_batch_first_lstm_h0_squeeze_cast_fp16")];
22
+ tensor<int32, [1]> lstm_out_batch_first_lstm_c0_squeeze_axes_0 = const()[name = tensor<string, []>("lstm_out_batch_first_lstm_c0_squeeze_axes_0"), val = tensor<int32, [1]>([0])];
23
+ tensor<fp16, [1, 1, 128]> c_state_in_to_fp16 = cast(dtype = c_state_in_to_fp16_dtype_0, x = c_state_in)[name = tensor<string, []>("cast_3")];
24
+ tensor<fp16, [1, 128]> lstm_out_batch_first_lstm_c0_squeeze_cast_fp16 = squeeze(axes = lstm_out_batch_first_lstm_c0_squeeze_axes_0, x = c_state_in_to_fp16)[name = tensor<string, []>("lstm_out_batch_first_lstm_c0_squeeze_cast_fp16")];
25
+ tensor<string, []> lstm_out_batch_first_direction_0 = const()[name = tensor<string, []>("lstm_out_batch_first_direction_0"), val = tensor<string, []>("forward")];
26
+ tensor<bool, []> lstm_out_batch_first_output_sequence_0 = const()[name = tensor<string, []>("lstm_out_batch_first_output_sequence_0"), val = tensor<bool, []>(true)];
27
+ tensor<string, []> lstm_out_batch_first_recurrent_activation_0 = const()[name = tensor<string, []>("lstm_out_batch_first_recurrent_activation_0"), val = tensor<string, []>("sigmoid")];
28
+ tensor<string, []> lstm_out_batch_first_cell_activation_0 = const()[name = tensor<string, []>("lstm_out_batch_first_cell_activation_0"), val = tensor<string, []>("tanh")];
29
+ tensor<string, []> lstm_out_batch_first_activation_0 = const()[name = tensor<string, []>("lstm_out_batch_first_activation_0"), val = tensor<string, []>("tanh")];
30
+ tensor<fp16, [512, 64]> concat_1_to_fp16_palettized = constexpr_lut_to_dense()[indices = tensor<uint8, [16384]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(37824))), lut = tensor<fp16, [16]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(54272))), name = tensor<string, []>("concat_1_to_fp16_palettized"), shape = tensor<uint32, [2]>([512, 64])];
31
+ tensor<fp16, [512, 128]> concat_2_to_fp16_palettized = constexpr_lut_to_dense()[indices = tensor<uint8, [32768]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(54400))), lut = tensor<fp16, [16]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(87232))), name = tensor<string, []>("concat_2_to_fp16_palettized"), shape = tensor<uint32, [2]>([512, 128])];
32
+ tensor<fp16, [512]> concat_0_to_fp16 = const()[name = tensor<string, []>("concat_0_to_fp16"), val = tensor<fp16, [512]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(87360)))];
33
+ tensor<fp16, [1, 1, 64]> input_5_batch_first_transpose_cast_fp16 = transpose(perm = input_5_batch_first_transpose_perm_0, x = input_5_cast_fp16)[name = tensor<string, []>("transpose_1")];
34
+ tensor<fp16, [1, 1, 128]> lstm_out_batch_first_cast_fp16_0, tensor<fp16, [1, 128]> lstm_out_batch_first_cast_fp16_1, tensor<fp16, [1, 128]> lstm_out_batch_first_cast_fp16_2 = lstm(activation = lstm_out_batch_first_activation_0, bias = concat_0_to_fp16, cell_activation = lstm_out_batch_first_cell_activation_0, direction = lstm_out_batch_first_direction_0, initial_c = lstm_out_batch_first_lstm_c0_squeeze_cast_fp16, initial_h = lstm_out_batch_first_lstm_h0_squeeze_cast_fp16, output_sequence = lstm_out_batch_first_output_sequence_0, recurrent_activation = lstm_out_batch_first_recurrent_activation_0, weight_hh = concat_2_to_fp16_palettized, weight_ih = concat_1_to_fp16_palettized, x = input_5_batch_first_transpose_cast_fp16)[name = tensor<string, []>("lstm_out_batch_first_cast_fp16")];
35
+ tensor<int32, [3]> lstm_out_perm_0 = const()[name = tensor<string, []>("lstm_out_perm_0"), val = tensor<int32, [3]>([1, 0, 2])];
36
+ tensor<int32, [1]> var_37_axes_0 = const()[name = tensor<string, []>("op_37_axes_0"), val = tensor<int32, [1]>([0])];
37
+ tensor<fp16, [1, 1, 128]> var_37_cast_fp16 = expand_dims(axes = var_37_axes_0, x = lstm_out_batch_first_cast_fp16_1)[name = tensor<string, []>("op_37_cast_fp16")];
38
+ tensor<string, []> var_37_cast_fp16_to_fp32_dtype_0 = const()[name = tensor<string, []>("op_37_cast_fp16_to_fp32_dtype_0"), val = tensor<string, []>("fp32")];
39
+ tensor<int32, [1]> var_38_axes_0 = const()[name = tensor<string, []>("op_38_axes_0"), val = tensor<int32, [1]>([0])];
40
+ tensor<fp16, [1, 1, 128]> var_38_cast_fp16 = expand_dims(axes = var_38_axes_0, x = lstm_out_batch_first_cast_fp16_2)[name = tensor<string, []>("op_38_cast_fp16")];
41
+ tensor<string, []> var_38_cast_fp16_to_fp32_dtype_0 = const()[name = tensor<string, []>("op_38_cast_fp16_to_fp32_dtype_0"), val = tensor<string, []>("fp32")];
42
+ tensor<int32, [1]> input_7_axes_0 = const()[name = tensor<string, []>("input_7_axes_0"), val = tensor<int32, [1]>([1])];
43
+ tensor<fp16, [1, 1, 128]> lstm_out_cast_fp16 = transpose(perm = lstm_out_perm_0, x = lstm_out_batch_first_cast_fp16_0)[name = tensor<string, []>("transpose_0")];
44
+ tensor<fp16, [1, 128]> input_7_cast_fp16 = squeeze(axes = input_7_axes_0, x = lstm_out_cast_fp16)[name = tensor<string, []>("input_7_cast_fp16")];
45
+ tensor<fp16, [64, 128]> decoder_0_weight_to_fp16_palettized = constexpr_lut_to_dense()[indices = tensor<uint8, [4096]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(88448))), lut = tensor<fp16, [16]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(92608))), name = tensor<string, []>("decoder_0_weight_to_fp16_palettized"), shape = tensor<uint32, [2]>([64, 128])];
46
+ tensor<fp16, [64]> decoder_0_bias_to_fp16 = const()[name = tensor<string, []>("decoder_0_bias_to_fp16"), val = tensor<fp16, [64]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(92736)))];
47
+ tensor<fp16, [1, 64]> linear_2_cast_fp16 = linear(bias = decoder_0_bias_to_fp16, weight = decoder_0_weight_to_fp16_palettized, x = input_7_cast_fp16)[name = tensor<string, []>("linear_2_cast_fp16")];
48
+ tensor<fp16, [1, 64]> input_11_cast_fp16 = relu(x = linear_2_cast_fp16)[name = tensor<string, []>("input_11_cast_fp16")];
49
+ tensor<fp16, [1, 64]> decoder_2_weight_to_fp16 = const()[name = tensor<string, []>("decoder_2_weight_to_fp16"), val = tensor<fp16, [1, 64]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(92928)))];
50
+ tensor<fp16, [1]> decoder_2_bias_to_fp16 = const()[name = tensor<string, []>("decoder_2_bias_to_fp16"), val = tensor<fp16, [1]>([-0x1.92p-4])];
51
+ tensor<fp16, [1, 1]> linear_3_cast_fp16 = linear(bias = decoder_2_bias_to_fp16, weight = decoder_2_weight_to_fp16, x = input_11_cast_fp16)[name = tensor<string, []>("linear_3_cast_fp16")];
52
+ tensor<fp16, [1, 1]> prob_cast_fp16 = sigmoid(x = linear_3_cast_fp16)[name = tensor<string, []>("prob_cast_fp16")];
53
+ tensor<int32, [1]> var_56_axes_0 = const()[name = tensor<string, []>("op_56_axes_0"), val = tensor<int32, [1]>([-1])];
54
+ tensor<fp16, [1]> var_56_cast_fp16 = squeeze(axes = var_56_axes_0, x = prob_cast_fp16)[name = tensor<string, []>("op_56_cast_fp16")];
55
+ tensor<string, []> var_56_cast_fp16_to_fp32_dtype_0 = const()[name = tensor<string, []>("op_56_cast_fp16_to_fp32_dtype_0"), val = tensor<string, []>("fp32")];
56
+ tensor<fp32, [1, 1, 128]> h_state_out = cast(dtype = var_37_cast_fp16_to_fp32_dtype_0, x = var_37_cast_fp16)[name = tensor<string, []>("cast_0")];
57
+ tensor<fp32, [1, 1, 128]> c_state_out = cast(dtype = var_38_cast_fp16_to_fp32_dtype_0, x = var_38_cast_fp16)[name = tensor<string, []>("cast_1")];
58
+ tensor<fp32, [1]> vad_probability = cast(dtype = var_56_cast_fp16_to_fp32_dtype_0, x = var_56_cast_fp16)[name = tensor<string, []>("cast_2")];
59
+ } -> (vad_probability, h_state_out, c_state_out);
60
+ }
silero_vad_stateful_4bit.mlmodelc/weights/weight.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f4767f28d716a87ffa0e446ae9dac70e1ca3708548e65691ae407071b56df8b
3
+ size 93120