cpatonn commited on
Commit
09c5b72
·
verified ·
1 Parent(s): 0bbe640

Upload folder using huggingface_hub

Browse files
chat_template.jinja CHANGED
@@ -1,17 +1,12 @@
1
- {% macro render_item_list(item_list, tag_name='required') %}
2
- {%- if item_list is defined and item_list is iterable and item_list | length > 0 %}
3
- {%- if tag_name %}{{- '\n<' ~ tag_name ~ '>' -}}{% endif %}
4
- {{- '[' }}
5
- {%- for item in item_list -%}
6
- {%- if loop.index > 1 %}{{- ", "}}{% endif -%}
7
- {%- if item is string -%}
8
- {{ "`" ~ item ~ "`" }}
9
- {%- else -%}
10
- {{ item }}
11
- {%- endif -%}
12
- {%- endfor -%}
13
- {{- ']' }}
14
- {%- if tag_name %}{{- '</' ~ tag_name ~ '>' -}}{% endif %}
15
  {%- endif %}
16
  {% endmacro %}
17
 
@@ -41,39 +36,30 @@
41
  {%- set tool = tool.function %}
42
  {%- endif %}
43
  {{- "\n<function>\n<name>" ~ tool.name ~ "</name>" }}
44
- {{- '\n<description>' ~ (tool.description | trim) ~ '</description>' }}
 
 
45
  {{- '\n<parameters>' }}
46
- {%- for param_name, param_fields in tool.parameters.properties|items %}
47
- {{- '\n<parameter>' }}
48
- {{- '\n<name>' ~ param_name ~ '</name>' }}
49
- {%- if param_fields.type is defined %}
50
- {{- '\n<type>' ~ (param_fields.type | string) ~ '</type>' }}
51
- {%- endif %}
52
- {%- if param_fields.description is defined %}
53
- {{- '\n<description>' ~ (param_fields.description | trim) ~ '</description>' }}
54
- {%- endif %}
55
- {{- render_item_list(param_fields.enum, 'enum') }}
56
- {%- set handled_keys = ['type', 'description', 'enum', 'required'] %}
57
- {%- for json_key in param_fields.keys() | reject("in", handled_keys) %}
58
- {%- set normed_json_key = json_key | replace("-", "_") | replace(" ", "_") | replace("$", "") %}
59
- {%- if param_fields[json_key] is mapping %}
60
- {{- '\n<' ~ normed_json_key ~ '>' ~ (param_fields[json_key] | tojson | safe) ~ '</' ~ normed_json_key ~ '>' }}
61
- {%- else %}
62
- {{-'\n<' ~ normed_json_key ~ '>' ~ (param_fields[json_key] | string) ~ '</' ~ normed_json_key ~ '>' }}
63
  {%- endif %}
 
 
 
 
 
 
64
  {%- endfor %}
65
- {{- render_item_list(param_fields.required, 'required') }}
66
- {{- '\n</parameter>' }}
67
- {%- endfor %}
68
- {{- render_item_list(tool.parameters.required, 'required') }}
69
- {{- '\n</parameters>' }}
70
- {%- if tool.return is defined %}
71
- {%- if tool.return is mapping %}
72
- {{- '\n<return>' ~ (tool.return | tojson | safe) ~ '</return>' }}
73
- {%- else %}
74
- {{- '\n<return>' ~ (tool.return | string) ~ '</return>' }}
75
- {%- endif %}
76
  {%- endif %}
 
 
 
 
 
77
  {{- '\n</function>' }}
78
  {%- endfor %}
79
  {{- "\n</tools>" }}
@@ -100,7 +86,7 @@
100
  {%- if tool_call.arguments is defined %}
101
  {%- for args_name, args_value in tool_call.arguments|items %}
102
  {{- '<parameter=' + args_name + '>\n' }}
103
- {%- set args_value = args_value if args_value is string else args_value | string %}
104
  {{- args_value }}
105
  {{- '\n</parameter>\n' }}
106
  {%- endfor %}
 
1
+ {% macro render_extra_keys(json_dict, handled_keys) %}
2
+ {%- if json_dict is mapping %}
3
+ {%- for json_key in json_dict if json_key not in handled_keys %}
4
+ {%- if json_dict[json_key] is mapping %}
5
+ {{- '\n<' ~ json_key ~ '>' ~ (json_dict[json_key] | tojson | safe) ~ '</' ~ json_key ~ '>' }}
6
+ {%- else %}
7
+ {{-'\n<' ~ json_key ~ '>' ~ (json_dict[json_key] | string) ~ '</' ~ json_key ~ '>' }}
8
+ {%- endif %}
9
+ {%- endfor %}
 
 
 
 
 
10
  {%- endif %}
11
  {% endmacro %}
12
 
 
36
  {%- set tool = tool.function %}
37
  {%- endif %}
38
  {{- "\n<function>\n<name>" ~ tool.name ~ "</name>" }}
39
+ {%- if tool.description is defined %}
40
+ {{- '\n<description>' ~ (tool.description | trim) ~ '</description>' }}
41
+ {%- endif %}
42
  {{- '\n<parameters>' }}
43
+ {%- if tool.parameters is defined and tool.parameters is mapping and tool.parameters.properties is defined and tool.parameters.properties is mapping %}
44
+ {%- for param_name, param_fields in tool.parameters.properties|items %}
45
+ {{- '\n<parameter>' }}
46
+ {{- '\n<name>' ~ param_name ~ '</name>' }}
47
+ {%- if param_fields.type is defined %}
48
+ {{- '\n<type>' ~ (param_fields.type | string) ~ '</type>' }}
 
 
 
 
 
 
 
 
 
 
 
49
  {%- endif %}
50
+ {%- if param_fields.description is defined %}
51
+ {{- '\n<description>' ~ (param_fields.description | trim) ~ '</description>' }}
52
+ {%- endif %}
53
+ {%- set handled_keys = ['name', 'type', 'description'] %}
54
+ {{- render_extra_keys(param_fields, handled_keys) }}
55
+ {{- '\n</parameter>' }}
56
  {%- endfor %}
 
 
 
 
 
 
 
 
 
 
 
57
  {%- endif %}
58
+ {% set handled_keys = ['type', 'properties'] %}
59
+ {{- render_extra_keys(tool.parameters, handled_keys) }}
60
+ {{- '\n</parameters>' }}
61
+ {%- set handled_keys = ['type', 'name', 'description', 'parameters'] %}
62
+ {{- render_extra_keys(tool, handled_keys) }}
63
  {{- '\n</function>' }}
64
  {%- endfor %}
65
  {{- "\n</tools>" }}
 
86
  {%- if tool_call.arguments is defined %}
87
  {%- for args_name, args_value in tool_call.arguments|items %}
88
  {{- '<parameter=' + args_name + '>\n' }}
89
+ {%- set args_value = args_value | tojson | safe if args_value is mapping else args_value | string %}
90
  {{- args_value }}
91
  {{- '\n</parameter>\n' }}
92
  {%- endfor %}
config.json CHANGED
@@ -5,6 +5,7 @@
5
  "attention_bias": false,
6
  "attention_dropout": 0.0,
7
  "decoder_sparse_step": 1,
 
8
  "eos_token_id": 151645,
9
  "head_dim": 128,
10
  "hidden_act": "silu",
@@ -27,18 +28,17 @@
27
  "quantization_config": {
28
  "config_groups": {
29
  "group_0": {
 
30
  "input_activations": null,
31
  "output_activations": null,
32
- "targets": [
33
- "Linear"
34
- ],
35
  "weights": {
36
  "actorder": null,
37
  "block_structure": null,
38
  "dynamic": false,
39
- "group_size": 128,
40
  "num_bits": 4,
41
- "observer": "minmax",
42
  "observer_kwargs": {},
43
  "strategy": "group",
44
  "symmetric": true,
@@ -101,7 +101,10 @@
101
  ],
102
  "kv_cache_scheme": null,
103
  "quant_method": "compressed-tensors",
104
- "quantization_status": "compressed"
 
 
 
105
  },
106
  "rms_norm_eps": 1e-06,
107
  "rope_scaling": null,
@@ -110,8 +113,7 @@
110
  "shared_expert_intermediate_size": 0,
111
  "sliding_window": null,
112
  "tie_word_embeddings": false,
113
- "torch_dtype": "bfloat16",
114
- "transformers_version": "4.55.0.dev0",
115
  "use_cache": true,
116
  "use_qk_norm": true,
117
  "use_sliding_window": false,
 
5
  "attention_bias": false,
6
  "attention_dropout": 0.0,
7
  "decoder_sparse_step": 1,
8
+ "dtype": "bfloat16",
9
  "eos_token_id": 151645,
10
  "head_dim": 128,
11
  "hidden_act": "silu",
 
28
  "quantization_config": {
29
  "config_groups": {
30
  "group_0": {
31
+ "format": "pack-quantized",
32
  "input_activations": null,
33
  "output_activations": null,
34
+ "targets": ["Linear"],
 
 
35
  "weights": {
36
  "actorder": null,
37
  "block_structure": null,
38
  "dynamic": false,
39
+ "group_size": 32,
40
  "num_bits": 4,
41
+ "observer": "mse",
42
  "observer_kwargs": {},
43
  "strategy": "group",
44
  "symmetric": true,
 
101
  ],
102
  "kv_cache_scheme": null,
103
  "quant_method": "compressed-tensors",
104
+ "quantization_status": "compressed",
105
+ "sparsity_config": {},
106
+ "transform_config": {},
107
+ "version": "0.10.3.dev47+ge463fe6"
108
  },
109
  "rms_norm_eps": 1e-06,
110
  "rope_scaling": null,
 
113
  "shared_expert_intermediate_size": 0,
114
  "sliding_window": null,
115
  "tie_word_embeddings": false,
116
+ "transformers_version": "4.56.0.dev0",
 
117
  "use_cache": true,
118
  "use_qk_norm": true,
119
  "use_sliding_window": false,
generation_config.json CHANGED
@@ -9,5 +9,5 @@
9
  "temperature": 0.7,
10
  "top_k": 20,
11
  "top_p": 0.8,
12
- "transformers_version": "4.55.0.dev0"
13
  }
 
9
  "temperature": 0.7,
10
  "top_k": 20,
11
  "top_p": 0.8,
12
+ "transformers_version": "4.56.0.dev0"
13
  }
model-00001-of-00004.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b587e8b52fcd54bffa5484858bdc6fc3a3597e9e3ecbaf8d555d9f2d01913a17
3
- size 5001524144
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e7cbf0e1cd141d81e3b206aa800b5bd2bd9bfd6f7fd5df65c44c3abf2ec39b19
3
+ size 5001707008
model-00002-of-00004.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:6dbb437f5b2753611f155b1dbb2579c711a423d3ca5e5fc838ca774f4ed0cdfc
3
- size 5001803304
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2aa05eba343bc30f9e2ad1415bf2108c4ea58107c3beb4717a63a707f2553a0f
3
+ size 5001283696
model-00003-of-00004.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:23935f50ca0bc2be771d59b681fbdaa76ade736688fa83861c0acc4298c59ee2
3
- size 5002084152
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:722b6bd956d867135f63b8f20ca8114a493522014fe0d511f612a2c765ee6377
3
+ size 5001283912
model-00004-of-00004.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:28baab4f614bf7bb38514bd453fafde6578c7587062ab381fcaa9ccf07bb171c
3
- size 1687667728
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e87552d12d99b872b152450fc61d37471b1e99daca2c1a168de14ef924dfbce1
3
+ size 3090232736
model.safetensors.index.json CHANGED
The diff for this file is too large to render. See raw diff
 
recipe.yaml CHANGED
@@ -1,9 +1,27 @@
1
- default_stage:
2
- default_modifiers:
3
  AWQModifier:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  targets: [Linear]
5
- ignore: [lm_head, 're:.*mlp.gate$', 're:.*mlp.shared_expert_gate$']
6
- scheme: W4A16
7
  mappings:
8
  - smooth_layer: re:.*input_layernorm$
9
  balance_layers: ['re:.*q_proj$', 're:.*k_proj$', 're:.*v_proj$']
 
1
+ quant_stage:
2
+ quant_modifiers:
3
  AWQModifier:
4
+ config_groups:
5
+ group_0:
6
+ targets: ['re:.*gate_proj.*', 're:.*up_proj.*', 're:.*down_proj.*', 're:.*k_proj.*',
7
+ 're:.*q_proj.*', 're:.*v_proj.*', 're:.*o_proj.*']
8
+ weights:
9
+ num_bits: 4
10
+ type: int
11
+ symmetric: true
12
+ group_size: 32
13
+ strategy: group
14
+ block_structure: null
15
+ dynamic: false
16
+ actorder: null
17
+ observer: mse
18
+ observer_kwargs: {}
19
+ input_activations: null
20
+ output_activations: null
21
+ format: null
22
  targets: [Linear]
23
+ ignore: [lm_head, model.embed_tokens, 're:.*input_layernorm$', 're:.*post_attention_layernorm$',
24
+ model.norm, 're:.*shared_experts.*', 're:.*mlp.gate']
25
  mappings:
26
  - smooth_layer: re:.*input_layernorm$
27
  balance_layers: ['re:.*q_proj$', 're:.*k_proj$', 're:.*v_proj$']