mlboydaisuke commited on
Commit
6324d15
·
verified ·
1 Parent(s): 1ac3254

Add macos-int8/: re-export with apple/coreai-models 97a14be (gate vs fp32 PASS; see MANIFEST.json)

Browse files
.gitattributes CHANGED
@@ -49,3 +49,10 @@ macos-fp16/Transformer.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
49
  macos-fp16/VAEDecoder.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
50
  macos-fp16/VAEEncoder.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
51
  macos-fp16/tokenizer/tokenizer.json filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
49
  macos-fp16/VAEDecoder.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
50
  macos-fp16/VAEEncoder.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
51
  macos-fp16/tokenizer/tokenizer.json filter=lfs diff=lfs merge=lfs -text
52
+ macos-int8/TextEncoder.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
53
+ macos-int8/Transformer.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
54
+ macos-int8/VAEDecoder.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
55
+ macos-int8/VAEDecoder_half.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
56
+ macos-int8/VAEEncoder.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
57
+ macos-int8/VAEEncoder_half.aimodel/main.mlirb filter=lfs diff=lfs merge=lfs -text
58
+ macos-int8/tokenizer/tokenizer.json filter=lfs diff=lfs merge=lfs -text
macos-int8/MANIFEST.json ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "folder": "macos-int8",
3
+ "hf_repo": "mlboydaisuke/FLUX.2-klein-4B-CoreAI",
4
+ "source": "black-forest-labs/FLUX.2-klein-4B @ e7b7dc27f91deacad38e78976d1f2b499d76a294",
5
+ "exporter": "apple/coreai-models @ 97a14be40bb1c5b95badb08b8532530443d62d26 (2026-10-09), coreai-core 1.0.0b3, coreai-torch 0.4.3, coreai-opt 0.3.0, torch 2.9.0, diffusers 0.37.1",
6
+ "runtime": "apple/coreai-models 97a14be Swift FlowTransformerPipeline, macOS 27.0 (26A428), GPU",
7
+ "gate_reference": "fp32 PyTorch (diffusers Flux2KleinPipeline through upstream's export wrappers, MPS); inputs built the way the Swift pipeline builds them; 4 prompts, seed 42",
8
+ "export_command": "uv run coreai.diffusion.export flux2-klein-4b --platform macOS --compression \"$(cat int8-block32.json)\"",
9
+ "compression_config": {
10
+ "execution_mode": "eager",
11
+ "global_config": {
12
+ "op_state_spec": {
13
+ "weight": {
14
+ "dtype": "int8",
15
+ "qscheme": "symmetric_with_clipping",
16
+ "granularity": {
17
+ "type": "per_block",
18
+ "block_size": 32
19
+ }
20
+ }
21
+ },
22
+ "op_input_spec": null,
23
+ "op_output_spec": null
24
+ },
25
+ "module_type_configs": {
26
+ "diffusers.models.normalization.RMSNorm": null,
27
+ "transformers.models.qwen3.modeling_qwen3.Qwen3RMSNorm": null,
28
+ "transformers.models.gemma2.modeling_gemma2.Gemma2RMSNorm": null,
29
+ "transformers.models.umt5.modeling_umt5.UMT5LayerNorm": null
30
+ }
31
+ },
32
+ "weights": "int8 per-block 32 (symmetric_with_clipping, weight-only) on the text encoder and the transformer, VAEs float16; float16 compute; one multi-function transformer with 8 entrypoints",
33
+ "gate": "PASS at 0.99: (i) text encoder mean token cos 0.9928-0.9948 over 4 prompts; (ii) transformer step-1 output cos 0.99981, rel-L2 0.019; (iii) VAE decoder 65.5 dB; end-to-end seed-42 image vs fp32 diffusers 23.3 dB",
34
+ "speed": "11.60 s per 1024x1024 image, 4 steps (median of 4 warm runs, 11.57-11.64 s), M4 Max, sample app",
35
+ "files": [
36
+ {
37
+ "path": "TextEncoder.aimodel/main.hash",
38
+ "bytes": 32,
39
+ "sha256": "8558b1f4aa801f5b1bd39d2b0fb1634172f10783f391253bb6fd974de2831295"
40
+ },
41
+ {
42
+ "path": "TextEncoder.aimodel/main.mlirb",
43
+ "bytes": 3309658432,
44
+ "sha256": "799fd1b013228a5881b1a8c76ffa7fb7d8d32cf9ae3bc934ceb3576cb83f3ed1"
45
+ },
46
+ {
47
+ "path": "TextEncoder.aimodel/metadata.json",
48
+ "bytes": 396,
49
+ "sha256": "969df49030383b607c5a88f3695fad60a111e3295996b39d9cad9193a77f5708"
50
+ },
51
+ {
52
+ "path": "Transformer.aimodel/main.hash",
53
+ "bytes": 32,
54
+ "sha256": "a8c9131a181c96cef60cb50c7b34789a8d91d9f9deeb2390e789feb3b3171550"
55
+ },
56
+ {
57
+ "path": "Transformer.aimodel/main.mlirb",
58
+ "bytes": 4119647410,
59
+ "sha256": "d12cf93fdc95b18c34ab25f6e1d856b0408128c49f1988ab70e965c940834cbd"
60
+ },
61
+ {
62
+ "path": "Transformer.aimodel/metadata.json",
63
+ "bytes": 396,
64
+ "sha256": "961fef07fe7e46edee339d7dae66ac4d9365a0131602ed2d00068211c885883a"
65
+ },
66
+ {
67
+ "path": "VAEDecoder.aimodel/main.hash",
68
+ "bytes": 32,
69
+ "sha256": "14ca6ebaa0108a4a26896f0db10447cb765534654f0087259be485062b984699"
70
+ },
71
+ {
72
+ "path": "VAEDecoder.aimodel/main.mlirb",
73
+ "bytes": 99294687,
74
+ "sha256": "b1f1b3aa14d5a72cd02ccdb8df05597bd1621a321971df8403fc602833d23cd7"
75
+ },
76
+ {
77
+ "path": "VAEDecoder.aimodel/metadata.json",
78
+ "bytes": 395,
79
+ "sha256": "8a1b1e691e799952d18ef4f887af42ca51ca57cef8e567eb1cdd6db3d64f07ed"
80
+ },
81
+ {
82
+ "path": "VAEDecoder_half.aimodel/main.hash",
83
+ "bytes": 32,
84
+ "sha256": "096cee4815cb7064914eb682d0f788e8016decf97805f3e72aa39f6374465ef7"
85
+ },
86
+ {
87
+ "path": "VAEDecoder_half.aimodel/main.mlirb",
88
+ "bytes": 99294656,
89
+ "sha256": "df1fe1fcba7da422fc0ddaac630f7fa27acc026ff1e06a826cb39ba3f01503c1"
90
+ },
91
+ {
92
+ "path": "VAEDecoder_half.aimodel/metadata.json",
93
+ "bytes": 400,
94
+ "sha256": "dd3d34c9da967af052f23d0b61fe60ceac8a5bceb2c624c4ed34b17e5f7058b9"
95
+ },
96
+ {
97
+ "path": "VAEEncoder.aimodel/main.hash",
98
+ "bytes": 32,
99
+ "sha256": "446e22e029653e213bd7279250da74ce94c0ab6cf8511910bf05dbc04e6acb39"
100
+ },
101
+ {
102
+ "path": "VAEEncoder.aimodel/main.mlirb",
103
+ "bytes": 68896263,
104
+ "sha256": "4a8c6a2e9b8b279c79561212aebe9fcba7370e1207a4cc8f638cdfc47181b28f"
105
+ },
106
+ {
107
+ "path": "VAEEncoder.aimodel/metadata.json",
108
+ "bytes": 395,
109
+ "sha256": "41ea40a3da58ec39c02e7477372a09641ae678cce79439260ae251fe5439cdab"
110
+ },
111
+ {
112
+ "path": "VAEEncoder_half.aimodel/main.hash",
113
+ "bytes": 32,
114
+ "sha256": "24f75f2701037b134fe477a11ef59b5c01dbb35b8364ffdad4dfdec82a852305"
115
+ },
116
+ {
117
+ "path": "VAEEncoder_half.aimodel/main.mlirb",
118
+ "bytes": 68896248,
119
+ "sha256": "93106dda09eb405580199f8bc235d53f52920d132065b3fec0c73b4fe7e4099f"
120
+ },
121
+ {
122
+ "path": "VAEEncoder_half.aimodel/metadata.json",
123
+ "bytes": 400,
124
+ "sha256": "63edab11ef710d82eb422f6deed9c8c69b04b65b954baa131da4f753264acaf6"
125
+ },
126
+ {
127
+ "path": "metadata.json",
128
+ "bytes": 1549,
129
+ "sha256": "a3a2afa5fd4cc185b6875f8a67306756694c8487710e69a0df1e6b879cef9ddb"
130
+ },
131
+ {
132
+ "path": "tokenizer/chat_template.jinja",
133
+ "bytes": 4168,
134
+ "sha256": "a55ee1b1660128b7098723e0abcd92caa0788061051c62d51cbe87d9cf1974d8"
135
+ },
136
+ {
137
+ "path": "tokenizer/config.json",
138
+ "bytes": 375,
139
+ "sha256": "b3f99a222a3edef3a756b61f6a67ada791c631aba983c13f59cb45aa9f6fb5f4"
140
+ },
141
+ {
142
+ "path": "tokenizer/tokenizer.json",
143
+ "bytes": 11422650,
144
+ "sha256": "be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506"
145
+ },
146
+ {
147
+ "path": "tokenizer/tokenizer_config.json",
148
+ "bytes": 375,
149
+ "sha256": "b3f99a222a3edef3a756b61f6a67ada791c631aba983c13f59cb45aa9f6fb5f4"
150
+ },
151
+ {
152
+ "path": "vae_bn_mean.npy",
153
+ "bytes": 640,
154
+ "sha256": "b2e3b98b3b1483e4573093d41b9e3890627724c7c0bfaa215ba1e2ef151b6d09"
155
+ },
156
+ {
157
+ "path": "vae_bn_var.npy",
158
+ "bytes": 640,
159
+ "sha256": "9418da87092c06ffb4f72402e3c3d142b671878f6cea5e8da3c547befbd64861"
160
+ }
161
+ ],
162
+ "file_count": 25,
163
+ "total_bytes": 7777120667,
164
+ "text_to_image_files": [
165
+ "metadata.json",
166
+ "tokenizer/chat_template.jinja",
167
+ "tokenizer/config.json",
168
+ "tokenizer/tokenizer.json",
169
+ "tokenizer/tokenizer_config.json",
170
+ "vae_bn_mean.npy",
171
+ "vae_bn_var.npy",
172
+ "VAEDecoder.aimodel/main.hash",
173
+ "VAEDecoder.aimodel/metadata.json",
174
+ "VAEDecoder.aimodel/main.mlirb",
175
+ "TextEncoder.aimodel/main.hash",
176
+ "TextEncoder.aimodel/metadata.json",
177
+ "TextEncoder.aimodel/main.mlirb",
178
+ "Transformer.aimodel/main.hash",
179
+ "Transformer.aimodel/metadata.json",
180
+ "Transformer.aimodel/main.mlirb"
181
+ ],
182
+ "text_to_image_bytes": 7540032209
183
+ }
macos-int8/TextEncoder.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ y�Ѱ"�X����o����,��;�4γWl�?>�
macos-int8/TextEncoder.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:799fd1b013228a5881b1a8c76ffa7fb7d8d32cf9ae3bc934ceb3576cb83f3ed1
3
+ size 3309658432
macos-int8/TextEncoder.aimodel/metadata.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "creationDate" : "20261009T205211Z",
3
+ "description" : "FLUX.2 [klein] 4B is a distilled, open-weights text-to-image rectified-flow transformer from Black Forest Labs. Source: https:\/\/huggingface.co\/black-forest-labs\/FLUX.2-klein-4B — TextEncoder component.",
4
+ "license" : "Apache-2.0",
5
+ "author" : "Black Forest Labs",
6
+ "assetVersion" : "2.0",
7
+ "producer" : "coreai-core 1.0.0b3"
8
+ }
macos-int8/Transformer.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ �,�?ܕ��4�%���V�@�(ğ��p�e�@�L�
macos-int8/Transformer.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d12cf93fdc95b18c34ab25f6e1d856b0408128c49f1988ab70e965c940834cbd
3
+ size 4119647410
macos-int8/Transformer.aimodel/metadata.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "creationDate" : "20261009T205134Z",
3
+ "description" : "FLUX.2 [klein] 4B is a distilled, open-weights text-to-image rectified-flow transformer from Black Forest Labs. Source: https:\/\/huggingface.co\/black-forest-labs\/FLUX.2-klein-4B — Transformer component.",
4
+ "license" : "Apache-2.0",
5
+ "author" : "Black Forest Labs",
6
+ "assetVersion" : "2.0",
7
+ "producer" : "coreai-core 1.0.0b3"
8
+ }
macos-int8/VAEDecoder.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ ��է,�,͸�Y{�b2q߄�`(3�<�
macos-int8/VAEDecoder.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b1f1b3aa14d5a72cd02ccdb8df05597bd1621a321971df8403fc602833d23cd7
3
+ size 99294687
macos-int8/VAEDecoder.aimodel/metadata.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "creationDate" : "20261009T205213Z",
3
+ "description" : "FLUX.2 [klein] 4B is a distilled, open-weights text-to-image rectified-flow transformer from Black Forest Labs. Source: https:\/\/huggingface.co\/black-forest-labs\/FLUX.2-klein-4B — VAEDecoder component.",
4
+ "license" : "Apache-2.0",
5
+ "author" : "Black Forest Labs",
6
+ "assetVersion" : "2.0",
7
+ "producer" : "coreai-core 1.0.0b3"
8
+ }
macos-int8/VAEDecoder_half.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ ����}�"�
macos-int8/VAEDecoder_half.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:df1fe1fcba7da422fc0ddaac630f7fa27acc026ff1e06a826cb39ba3f01503c1
3
+ size 99294656
macos-int8/VAEDecoder_half.aimodel/metadata.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "creationDate" : "20261009T205214Z",
3
+ "description" : "FLUX.2 [klein] 4B is a distilled, open-weights text-to-image rectified-flow transformer from Black Forest Labs. Source: https:\/\/huggingface.co\/black-forest-labs\/FLUX.2-klein-4B — VAEDecoder_half component.",
4
+ "license" : "Apache-2.0",
5
+ "author" : "Black Forest Labs",
6
+ "assetVersion" : "2.0",
7
+ "producer" : "coreai-core 1.0.0b3"
8
+ }
macos-int8/VAEEncoder.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ J�j.��'�yV���˧7�̏c���q���
macos-int8/VAEEncoder.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4a8c6a2e9b8b279c79561212aebe9fcba7370e1207a4cc8f638cdfc47181b28f
3
+ size 68896263
macos-int8/VAEEncoder.aimodel/metadata.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "creationDate" : "20261009T205213Z",
3
+ "description" : "FLUX.2 [klein] 4B is a distilled, open-weights text-to-image rectified-flow transformer from Black Forest Labs. Source: https:\/\/huggingface.co\/black-forest-labs\/FLUX.2-klein-4B — VAEEncoder component.",
4
+ "license" : "Apache-2.0",
5
+ "author" : "Black Forest Labs",
6
+ "assetVersion" : "2.0",
7
+ "producer" : "coreai-core 1.0.0b3"
8
+ }
macos-int8/VAEEncoder_half.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ �m� �@U����5�?R�
macos-int8/VAEEncoder_half.aimodel/main.mlirb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:93106dda09eb405580199f8bc235d53f52920d132065b3fec0c73b4fe7e4099f
3
+ size 68896248
macos-int8/VAEEncoder_half.aimodel/metadata.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "creationDate" : "20261009T205215Z",
3
+ "description" : "FLUX.2 [klein] 4B is a distilled, open-weights text-to-image rectified-flow transformer from Black Forest Labs. Source: https:\/\/huggingface.co\/black-forest-labs\/FLUX.2-klein-4B — VAEEncoder_half component.",
4
+ "license" : "Apache-2.0",
5
+ "author" : "Black Forest Labs",
6
+ "assetVersion" : "2.0",
7
+ "producer" : "coreai-core 1.0.0b3"
8
+ }
macos-int8/metadata.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata_version": "0.2",
3
+ "kind": "diffusion",
4
+ "name": "FLUX.2-klein-4B",
5
+ "assets": {
6
+ "transformer": "Transformer.aimodel",
7
+ "text_encoder": "TextEncoder.aimodel",
8
+ "vae_decoder": "VAEDecoder.aimodel",
9
+ "vae_encoder": "VAEEncoder.aimodel",
10
+ "vae_decoder_half": "VAEDecoder_half.aimodel",
11
+ "vae_encoder_half": "VAEEncoder_half.aimodel"
12
+ },
13
+ "diffusion": {
14
+ "type": "flux2",
15
+ "prediction_type": "flow_matching",
16
+ "encoder_scale_factor": 1.0,
17
+ "decoder_scale_factor": 1.0,
18
+ "decoder_shift_factor": 0.0,
19
+ "batch_norm_eps": 0.0001,
20
+ "guidance_embeds": false,
21
+ "image_size": 1024,
22
+ "default_guidance_scale": 1.0,
23
+ "default_steps": 4,
24
+ "rope_axes_dims": [
25
+ 32,
26
+ 32,
27
+ 32,
28
+ 32
29
+ ],
30
+ "rope_theta": 2000
31
+ },
32
+ "source": {
33
+ "model_definition": "torch",
34
+ "hf_model_id": "black-forest-labs/FLUX.2-klein-4B"
35
+ },
36
+ "compression": "{\"execution_mode\": \"eager\",\n \"global_config\": {\"op_state_spec\": {\"weight\": {\"dtype\": \"int8\", \"qscheme\": \"symmetric_with_clipping\", \"granularity\": {\"type\": \"per_block\", \"block_size\": 32}}}, \"op_input_spec\": null, \"op_output_spec\": null},\n \"module_type_configs\": {\"diffusers.models.normalization.RMSNorm\": null, \"transformers.models.qwen3.modeling_qwen3.Qwen3RMSNorm\": null, \"transformers.models.gemma2.modeling_gemma2.Gemma2RMSNorm\": null, \"transformers.models.umt5.modeling_umt5.UMT5LayerNorm\": null}}",
37
+ "compilation": {
38
+ "date": "2026-10-10T05:52:15.426099+09:00",
39
+ "targets": []
40
+ }
41
+ }
macos-int8/tokenizer/chat_template.jinja ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0].role == 'system' %}
4
+ {{- messages[0].content + '\n\n' }}
5
+ {%- endif %}
6
+ {{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
7
+ {%- for tool in tools %}
8
+ {{- "\n" }}
9
+ {{- tool | tojson }}
10
+ {%- endfor %}
11
+ {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
12
+ {%- else %}
13
+ {%- if messages[0].role == 'system' %}
14
+ {{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
15
+ {%- endif %}
16
+ {%- endif %}
17
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
18
+ {%- for message in messages[::-1] %}
19
+ {%- set index = (messages|length - 1) - loop.index0 %}
20
+ {%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
21
+ {%- set ns.multi_step_tool = false %}
22
+ {%- set ns.last_query_index = index %}
23
+ {%- endif %}
24
+ {%- endfor %}
25
+ {%- for message in messages %}
26
+ {%- if message.content is string %}
27
+ {%- set content = message.content %}
28
+ {%- else %}
29
+ {%- set content = '' %}
30
+ {%- endif %}
31
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
32
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
33
+ {%- elif message.role == "assistant" %}
34
+ {%- set reasoning_content = '' %}
35
+ {%- if message.reasoning_content is string %}
36
+ {%- set reasoning_content = message.reasoning_content %}
37
+ {%- else %}
38
+ {%- if '</think>' in content %}
39
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
40
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
41
+ {%- endif %}
42
+ {%- endif %}
43
+ {%- if loop.index0 > ns.last_query_index %}
44
+ {%- if loop.last or (not loop.last and reasoning_content) %}
45
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
46
+ {%- else %}
47
+ {{- '<|im_start|>' + message.role + '\n' + content }}
48
+ {%- endif %}
49
+ {%- else %}
50
+ {{- '<|im_start|>' + message.role + '\n' + content }}
51
+ {%- endif %}
52
+ {%- if message.tool_calls %}
53
+ {%- for tool_call in message.tool_calls %}
54
+ {%- if (loop.first and content) or (not loop.first) %}
55
+ {{- '\n' }}
56
+ {%- endif %}
57
+ {%- if tool_call.function %}
58
+ {%- set tool_call = tool_call.function %}
59
+ {%- endif %}
60
+ {{- '<tool_call>\n{"name": "' }}
61
+ {{- tool_call.name }}
62
+ {{- '", "arguments": ' }}
63
+ {%- if tool_call.arguments is string %}
64
+ {{- tool_call.arguments }}
65
+ {%- else %}
66
+ {{- tool_call.arguments | tojson }}
67
+ {%- endif %}
68
+ {{- '}\n</tool_call>' }}
69
+ {%- endfor %}
70
+ {%- endif %}
71
+ {{- '<|im_end|>\n' }}
72
+ {%- elif message.role == "tool" %}
73
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
74
+ {{- '<|im_start|>user' }}
75
+ {%- endif %}
76
+ {{- '\n<tool_response>\n' }}
77
+ {{- content }}
78
+ {{- '\n</tool_response>' }}
79
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
80
+ {{- '<|im_end|>\n' }}
81
+ {%- endif %}
82
+ {%- endif %}
83
+ {%- endfor %}
84
+ {%- if add_generation_prompt %}
85
+ {{- '<|im_start|>assistant\n' }}
86
+ {%- if enable_thinking is defined and enable_thinking is false %}
87
+ {{- '<think>\n\n</think>\n\n' }}
88
+ {%- endif %}
89
+ {%- endif %}
macos-int8/tokenizer/config.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": null,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "is_local": true,
9
+ "local_files_only": false,
10
+ "model_max_length": 131072,
11
+ "pad_token": "<|endoftext|>",
12
+ "split_special_tokens": false,
13
+ "tokenizer_class": "GPT2Tokenizer",
14
+ "unk_token": null
15
+ }
macos-int8/tokenizer/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506
3
+ size 11422650
macos-int8/tokenizer/tokenizer_config.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": null,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "is_local": true,
9
+ "local_files_only": false,
10
+ "model_max_length": 131072,
11
+ "pad_token": "<|endoftext|>",
12
+ "split_special_tokens": false,
13
+ "tokenizer_class": "GPT2Tokenizer",
14
+ "unk_token": null
15
+ }
macos-int8/vae_bn_mean.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2e3b98b3b1483e4573093d41b9e3890627724c7c0bfaa215ba1e2ef151b6d09
3
+ size 640
macos-int8/vae_bn_var.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9418da87092c06ffb4f72402e3c3d142b671878f6cea5e8da3c547befbd64861
3
+ size 640