satreysa commited on
Commit
a31ccf8
·
verified ·
1 Parent(s): 3731b5b

Upload folder using huggingface_hub

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
+ model_jit.onnx.data filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - zh
4
+ - en
5
+ tags:
6
+ - glm
7
+ - chatglm
8
+ - thudm
9
+ - ryzenai-npu
10
+ base_model: THUDM/chatglm3-6b
11
+ ---
12
+
13
+ # chatglm3-6b
14
+ - ## Introduction
15
+ This model was created using Quark Quantization, followed by OGA Model Builder, and finalized with post-processing for NPU deployment.
16
+ - ## Quantization Strategy
17
+ - AWQ / Group 128 / Asymmetric / BF16 activations / UINT4 weights
18
+
19
+ - ## Quick Start
20
+ For quickstart, refer to [Ryzen AI doucmentation](https://ryzenai.docs.amd.com/en/latest/npu_oga.html)
21
+
22
+ #### Evaluation scores
23
+ The perplexity measurement is run on the wikitext-2-raw-v1 (raw data) dataset provided by Hugging Face. Perplexity score measured for prompt length 2k is 29.81679.
24
+
25
+
26
+
27
+ #### License
28
+ Modifications copyright(c) 2024 Advanced Micro Devices,Inc. All rights reserved.
29
+
30
+ Licensed under the Apache License, Version 2.0 (the "License");
31
+ you may not use this file except in compliance with the License.
32
+ You may obtain a copy of the License at
33
+
34
+ http://www.apache.org/licenses/LICENSE-2.0
35
+
36
+ Unless required by applicable law or agreed to in writing, software
37
+ distributed under the License is distributed on an "AS IS" BASIS,
38
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39
+ See the License for the specific language governing permissions and
40
+ limitations under the License.
chat_template.jinja ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if messages[0]['role'] == 'system' %}
2
+ {%- set system_message = messages[0]['content'] %}
3
+ {%- set loop_messages = messages[1:] %}
4
+ {%- else %}
5
+ {%- set loop_messages = messages %}
6
+ {%- endif %}
7
+
8
+ {{- bos_token }}
9
+ {%- for message in loop_messages %}
10
+ {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}
11
+ {{- raise_exception('After the optional system message, conversation roles must alternate user/assistant/user/assistant/...') }}
12
+ {%- endif %}
13
+ {%- if message['role'] == 'user' %}
14
+ {%- if loop.first and system_message is defined %}
15
+ {{- ' [INST] ' + system_message + '\n\n' + message['content'] + ' [/INST]' }}
16
+ {%- else %}
17
+ {{- ' [INST] ' + message['content'] + ' [/INST]' }}
18
+ {%- endif %}
19
+ {%- elif message['role'] == 'assistant' %}
20
+ {{- ' ' + message['content'] + eos_token}}
21
+ {%- else %}
22
+ {{- raise_exception('Only user and assistant roles are supported, with the exception of an initial optional system message!') }}
23
+ {%- endif %}
24
+ {%- endfor %}
config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {}
genai_config.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": {
3
+ "bos_token_id": 1,
4
+ "context_length": 32768,
5
+ "decoder": {
6
+ "session_options": {
7
+ "log_id": "onnxruntime-genai",
8
+ "custom_ops_library": "onnx_custom_ops.dll",
9
+ "custom_allocator": "shared_d3d_xrt",
10
+ "external_data_file": "model_jit.pb.bin",
11
+ "config_entries": {
12
+ "hybrid_opt_max_seq_length": "4096"
13
+ },
14
+ "provider_options": []
15
+ },
16
+ "filename": "model_jit.onnx",
17
+ "head_size": 128,
18
+ "hidden_size": 4096,
19
+ "inputs": {
20
+ "input_ids": "input_ids",
21
+ "attention_mask": "attention_mask",
22
+ "position_ids": "position_ids",
23
+ "past_key_names": "past_key_values.%d.key",
24
+ "past_value_names": "past_key_values.%d.value"
25
+ },
26
+ "outputs": {
27
+ "logits": "logits",
28
+ "present_key_names": "present.%d.key",
29
+ "present_value_names": "present.%d.value"
30
+ },
31
+ "num_attention_heads": 32,
32
+ "num_hidden_layers": 32,
33
+ "num_key_value_heads": 8
34
+ },
35
+ "eos_token_id": 2,
36
+ "pad_token_id": 2,
37
+ "type": "mistral",
38
+ "vocab_size": 32000
39
+ },
40
+ "search": {
41
+ "diversity_penalty": 0.0,
42
+ "do_sample": false,
43
+ "early_stopping": true,
44
+ "length_penalty": 1.0,
45
+ "max_length": 32768,
46
+ "min_length": 0,
47
+ "no_repeat_ngram_size": 0,
48
+ "num_beams": 1,
49
+ "num_return_sequences": 1,
50
+ "past_present_share_buffer": true,
51
+ "repetition_penalty": 1.0,
52
+ "temperature": 1.0,
53
+ "top_k": 50,
54
+ "top_p": 1.0
55
+ }
56
+ }
model_jit.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c9066855d9b1dda3d72f5eae46d02871d49bbede966363ea25caa30335cecfd0
3
+ size 3873158144
model_jit.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:609befff41aa49c6ba8e13c0b8b56226bdee4f486d9036a25cc8147ac3c3164e
3
+ size 348829
model_jit.onnx.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f7577f13bc247d17576a94643beff2625300744fa03d61ae25c77a29ee9736ba
3
+ size 3965856256
model_jit.pb.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cbfd2009b43bb8dd62954e2bb0b18d93bbfd2eae619850d40eab730f701261c6
3
+ size 7918
rai_config.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "max_prompt_length": {
3
+ "1.3.1": 2048,
4
+ "1.4.0": 2048,
5
+ "1.4.1": 2048,
6
+ "1.5.0": 2048,
7
+ "1.5.1" : 2048,
8
+ "1.6.0": 4096
9
+ }
10
+
11
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "</s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "unk_token": {
24
+ "content": "<unk>",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ }
30
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dadfd56d766715c61d2ef780a525ab43b8e6da4de6865bda3d95fdef5e134055
3
+ size 493443
tokenizer_config.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "add_prefix_space": null,
5
+ "added_tokens_decoder": {
6
+ "0": {
7
+ "content": "<unk>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false,
12
+ "special": true
13
+ },
14
+ "1": {
15
+ "content": "<s>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false,
20
+ "special": true
21
+ },
22
+ "2": {
23
+ "content": "</s>",
24
+ "lstrip": false,
25
+ "normalized": false,
26
+ "rstrip": false,
27
+ "single_word": false,
28
+ "special": true
29
+ }
30
+ },
31
+ "additional_special_tokens": [],
32
+ "bos_token": "<s>",
33
+ "clean_up_tokenization_spaces": false,
34
+ "eos_token": "</s>",
35
+ "extra_special_tokens": {},
36
+ "legacy": false,
37
+ "model_max_length": 1000000000000000019884624838656,
38
+ "pad_token": "</s>",
39
+ "padding_side": "left",
40
+ "sp_model_kwargs": {},
41
+ "spaces_between_special_tokens": false,
42
+ "tokenizer_class": "LlamaTokenizer",
43
+ "unk_token": "<unk>",
44
+ "use_default_system_prompt": false
45
+ }