Rahspide commited on
Commit
ccf2421
·
verified ·
1 Parent(s): 6384ded

mnn: INT4 weights for the MNN runtime

Browse files
.gitattributes CHANGED
@@ -36,3 +36,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
36
  gguf/MNN-Pocket-0.3B-RU-Chat-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
37
  gguf/MNN-Pocket-0.3B-RU-Chat-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
38
  assets/cover_chat.png filter=lfs diff=lfs merge=lfs -text
 
 
 
 
36
  gguf/MNN-Pocket-0.3B-RU-Chat-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
37
  gguf/MNN-Pocket-0.3B-RU-Chat-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
38
  assets/cover_chat.png filter=lfs diff=lfs merge=lfs -text
39
+ mnn/MNN-Pocket-0.3B-RU-Chat-INT4/llm.mnn filter=lfs diff=lfs merge=lfs -text
40
+ mnn/MNN-Pocket-0.3B-RU-Chat-INT4/llm.mnn.weight filter=lfs diff=lfs merge=lfs -text
41
+ mnn/MNN-Pocket-0.3B-RU-Chat-INT4/tokenizer.mtok filter=lfs diff=lfs merge=lfs -text
mnn/MNN-Pocket-0.3B-RU-Chat-INT4/config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "llm_model": "llm.mnn",
3
+ "llm_weight": "llm.mnn.weight",
4
+ "backend_type": "cpu",
5
+ "thread_num": 4,
6
+ "precision": "low",
7
+ "memory": "low",
8
+ "sampler_type": "mixed",
9
+ "temperature": 0.8,
10
+ "top_k": 40,
11
+ "top_p": 0.9,
12
+ "min_p": 0.05,
13
+ "tfs_z": 1.0,
14
+ "typical": 0.95,
15
+ "repetition_penalty": 1.0,
16
+ "presence_penalty": 0.0,
17
+ "frequency_penalty": 0.0,
18
+ "penalty_window": 0,
19
+ "n_gram": 8,
20
+ "ngram_factor": 1.0,
21
+ "tokenizer_file": "tokenizer.mtok"
22
+ }
mnn/MNN-Pocket-0.3B-RU-Chat-INT4/llm.mnn ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b701fa523183db03ea009943f173620ff6aea5c14457afa74261e4511877375
3
+ size 725608
mnn/MNN-Pocket-0.3B-RU-Chat-INT4/llm.mnn.weight ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:52e7afc4145660cfac20fc50e4747a1f77402377e745bad5fe6e8983ef7bd18c
3
+ size 170724594
mnn/MNN-Pocket-0.3B-RU-Chat-INT4/llm_config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "qwen3",
3
+ "hidden_size": 896,
4
+ "layer_nums": 28,
5
+ "attention_mask": "float",
6
+ "attention_type": "full",
7
+ "is_mrope": false,
8
+ "max_position_embeddings": 40960,
9
+ "jinja": {
10
+ "chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n\\n' }}\n {%- endif %}\n {{- \"# 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>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\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\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0].content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if message.content is string %}\n {%- set content = message.content %}\n {%- else %}\n {%- set content = '' %}\n {%- endif %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}",
11
+ "eos": "<|im_end|>"
12
+ },
13
+ "tie_embeddings": {
14
+ "weight_offset": 137694450,
15
+ "alpha_offset": 167054578,
16
+ "alpha_size": 3670016,
17
+ "quant_bit": 4,
18
+ "quant_block": 64,
19
+ "alpha_dtype": "fp16"
20
+ }
21
+ }
mnn/MNN-Pocket-0.3B-RU-Chat-INT4/tokenizer.mtok ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:94e81007f6a83ea8da0b1ae4bda5fb79fef6941e246dd653354f1461e66186b8
3
+ size 1710857