FabioTrindade commited on
Commit
d20917f
·
verified ·
1 Parent(s): 0c5a090

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
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
chat_template.jinja ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{- bos_token }}
2
+ {%- if custom_tools is defined %}
3
+ {%- set tools = custom_tools %}
4
+ {%- endif %}
5
+ {%- if not tools_in_user_message is defined %}
6
+ {%- set tools_in_user_message = true %}
7
+ {%- endif %}
8
+ {%- if not date_string is defined %}
9
+ {%- set date_string = "26 Jul 2024" %}
10
+ {%- endif %}
11
+ {%- if not tools is defined %}
12
+ {%- set tools = none %}
13
+ {%- endif %}
14
+
15
+ {#- This block extracts the system message, so we can slot it into the right place. #}
16
+ {%- if messages[0]['role'] == 'system' %}
17
+ {%- set system_message = messages[0]['content']|trim %}
18
+ {%- set messages = messages[1:] %}
19
+ {%- else %}
20
+ {%- set system_message = "" %}
21
+ {%- endif %}
22
+
23
+ {#- System message + builtin tools #}
24
+ {{- "<|start_header_id|>system<|end_header_id|>\n\n" }}
25
+ {%- if builtin_tools is defined or tools is not none %}
26
+ {{- "Environment: ipython\n" }}
27
+ {%- endif %}
28
+ {%- if builtin_tools is defined %}
29
+ {{- "Tools: " + builtin_tools | reject('equalto', 'code_interpreter') | join(", ") + "\n\n"}}
30
+ {%- endif %}
31
+ {{- "Cutting Knowledge Date: December 2023\n" }}
32
+ {{- "Today Date: " + date_string + "\n\n" }}
33
+ {%- if tools is not none and not tools_in_user_message %}
34
+ {{- "You have access to the following functions. To call a function, please respond with JSON for a function call." }}
35
+ {{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
36
+ {{- "Do not use variables.\n\n" }}
37
+ {%- for t in tools %}
38
+ {{- t | tojson(indent=4) }}
39
+ {{- "\n\n" }}
40
+ {%- endfor %}
41
+ {%- endif %}
42
+ {{- system_message }}
43
+ {{- "<|eot_id|>" }}
44
+
45
+ {#- Custom tools are passed in a user message with some extra guidance #}
46
+ {%- if tools_in_user_message and not tools is none %}
47
+ {#- Extract the first user message so we can plug it in here #}
48
+ {%- if messages | length != 0 %}
49
+ {%- set first_user_message = messages[0]['content']|trim %}
50
+ {%- set messages = messages[1:] %}
51
+ {%- else %}
52
+ {{- raise_exception("Cannot put tools in the first user message when there's no first user message!") }}
53
+ {%- endif %}
54
+ {{- '<|start_header_id|>user<|end_header_id|>\n\n' -}}
55
+ {{- "Given the following functions, please respond with a JSON for a function call " }}
56
+ {{- "with its proper arguments that best answers the given prompt.\n\n" }}
57
+ {{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
58
+ {{- "Do not use variables.\n\n" }}
59
+ {%- for t in tools %}
60
+ {{- t | tojson(indent=4) }}
61
+ {{- "\n\n" }}
62
+ {%- endfor %}
63
+ {{- first_user_message + "<|eot_id|>"}}
64
+ {%- endif %}
65
+
66
+ {%- for message in messages %}
67
+ {%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}
68
+ {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' }}
69
+ {%- elif 'tool_calls' in message %}
70
+ {%- if not message.tool_calls|length == 1 %}
71
+ {{- raise_exception("This model only supports single tool-calls at once!") }}
72
+ {%- endif %}
73
+ {%- set tool_call = message.tool_calls[0].function %}
74
+ {%- if builtin_tools is defined and tool_call.name in builtin_tools %}
75
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
76
+ {{- "<|python_tag|>" + tool_call.name + ".call(" }}
77
+ {%- for arg_name, arg_val in tool_call.arguments | items %}
78
+ {{- arg_name + '="' + arg_val + '"' }}
79
+ {%- if not loop.last %}
80
+ {{- ", " }}
81
+ {%- endif %}
82
+ {%- endfor %}
83
+ {{- ")" }}
84
+ {%- else %}
85
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
86
+ {{- '{"name": "' + tool_call.name + '", ' }}
87
+ {{- '"parameters": ' }}
88
+ {{- tool_call.arguments | tojson }}
89
+ {{- "}" }}
90
+ {%- endif %}
91
+ {%- if builtin_tools is defined %}
92
+ {#- This means we're in ipython mode #}
93
+ {{- "<|eom_id|>" }}
94
+ {%- else %}
95
+ {{- "<|eot_id|>" }}
96
+ {%- endif %}
97
+ {%- elif message.role == "tool" or message.role == "ipython" %}
98
+ {{- "<|start_header_id|>ipython<|end_header_id|>\n\n" }}
99
+ {%- if message.content is mapping or message.content is iterable %}
100
+ {{- message.content | tojson }}
101
+ {%- else %}
102
+ {{- message.content }}
103
+ {%- endif %}
104
+ {{- "<|eot_id|>" }}
105
+ {%- endif %}
106
+ {%- endfor %}
107
+ {%- if add_generation_prompt %}
108
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' }}
109
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlamaForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 128000,
8
+ "dtype": "bfloat16",
9
+ "eos_token_id": [
10
+ 128001,
11
+ 128008,
12
+ 128009
13
+ ],
14
+ "head_dim": 128,
15
+ "hidden_act": "silu",
16
+ "hidden_size": 8192,
17
+ "initializer_range": 0.02,
18
+ "intermediate_size": 28672,
19
+ "max_position_embeddings": 131072,
20
+ "mlp_bias": false,
21
+ "model_type": "llama",
22
+ "num_attention_heads": 64,
23
+ "num_hidden_layers": 80,
24
+ "num_key_value_heads": 8,
25
+ "pad_token_id": null,
26
+ "pretraining_tp": 1,
27
+ "quantization_config": {
28
+ "config_groups": {
29
+ "group_0": {
30
+ "format": "int-quantized",
31
+ "input_activations": {
32
+ "actorder": null,
33
+ "block_structure": null,
34
+ "dynamic": false,
35
+ "group_size": null,
36
+ "num_bits": 8,
37
+ "observer": "memoryless_minmax",
38
+ "observer_kwargs": {},
39
+ "scale_dtype": null,
40
+ "strategy": "tensor",
41
+ "symmetric": true,
42
+ "type": "int",
43
+ "zp_dtype": null
44
+ },
45
+ "output_activations": null,
46
+ "targets": [
47
+ "Linear"
48
+ ],
49
+ "weights": {
50
+ "actorder": "static",
51
+ "block_structure": null,
52
+ "dynamic": false,
53
+ "group_size": null,
54
+ "num_bits": 8,
55
+ "observer": "memoryless_minmax",
56
+ "observer_kwargs": {},
57
+ "scale_dtype": null,
58
+ "strategy": "tensor",
59
+ "symmetric": true,
60
+ "type": "int",
61
+ "zp_dtype": null
62
+ }
63
+ }
64
+ },
65
+ "format": "int-quantized",
66
+ "global_compression_ratio": null,
67
+ "ignore": [
68
+ "lm_head"
69
+ ],
70
+ "kv_cache_scheme": null,
71
+ "quant_method": "compressed-tensors",
72
+ "quantization_status": "compressed",
73
+ "sparsity_config": {},
74
+ "transform_config": {
75
+ "config_groups": {
76
+ "R1": {
77
+ "apply": [
78
+ {
79
+ "ignore": [],
80
+ "inverse": false,
81
+ "location": "weight_output",
82
+ "targets": [
83
+ "re:.*embed_tokens$",
84
+ "re:.*o_proj$",
85
+ "re:.*down_proj$"
86
+ ]
87
+ },
88
+ {
89
+ "ignore": [],
90
+ "inverse": true,
91
+ "location": "weight_input",
92
+ "targets": [
93
+ "re:.*q_proj$",
94
+ "re:.*k_proj$",
95
+ "re:.*v_proj$",
96
+ "re:.*up_proj$",
97
+ "re:.*gate_proj$",
98
+ "lm_head"
99
+ ]
100
+ }
101
+ ],
102
+ "head_dim": 128,
103
+ "precision": "torch.float64",
104
+ "randomize": false,
105
+ "requires_grad": false,
106
+ "type": "hadamard"
107
+ },
108
+ "R2": {
109
+ "apply": [
110
+ {
111
+ "ignore": [],
112
+ "inverse": false,
113
+ "location": "weight_output",
114
+ "targets": [
115
+ "re:.*v_proj$"
116
+ ]
117
+ },
118
+ {
119
+ "ignore": [],
120
+ "inverse": true,
121
+ "location": "weight_input",
122
+ "targets": [
123
+ "re:.*o_proj$"
124
+ ]
125
+ }
126
+ ],
127
+ "head_dim": 128,
128
+ "precision": "torch.float64",
129
+ "randomize": false,
130
+ "requires_grad": false,
131
+ "type": "hadamard"
132
+ }
133
+ }
134
+ },
135
+ "version": "0.17.1"
136
+ },
137
+ "rms_norm_eps": 1e-05,
138
+ "rope_parameters": {
139
+ "factor": 8.0,
140
+ "high_freq_factor": 4.0,
141
+ "low_freq_factor": 1.0,
142
+ "original_max_position_embeddings": 8192,
143
+ "rope_theta": 500000.0,
144
+ "rope_type": "llama3"
145
+ },
146
+ "tie_word_embeddings": false,
147
+ "transformers_version": "5.10.1",
148
+ "use_cache": true,
149
+ "vocab_size": 128256
150
+ }
generation_config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 128000,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 128001,
6
+ 128008,
7
+ 128009
8
+ ],
9
+ "temperature": 0.6,
10
+ "top_p": 0.9,
11
+ "transformers_version": "5.10.1"
12
+ }
model-00001-of-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:beed6a80a49889aa6087223fa96d8ea2952dd2be23efdc22c2acd6f3302b09d5
3
+ size 49788283778
model-00002-of-00002.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e8276fad078db46da0eec9d7552acc00f122f92ec65e31fe9024873101d10a7
3
+ size 22868298158
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
recipe.yaml ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ default_stage:
2
+ default_modifiers:
3
+ SmoothQuantModifier:
4
+ smoothing_strength: 0.5
5
+ mappings:
6
+ - !!python/tuple
7
+ - ['re:.*q_proj', 're:.*k_proj', 're:.*v_proj']
8
+ - re:.*input_layernorm
9
+ - !!python/tuple
10
+ - ['re:.*gate_proj', 're:.*up_proj']
11
+ - re:.*post_attention_layernorm
12
+ ignore: []
13
+ algorithm: smoothquant
14
+ SpinQuantModifier:
15
+ rotations: [R1, R2]
16
+ transform_type: hadamard
17
+ randomize: false
18
+ learnable: false
19
+ precision: torch.float64
20
+ transform_block_size: 128
21
+ transform_config:
22
+ config_groups:
23
+ R1:
24
+ type: hadamard
25
+ apply:
26
+ - targets: ['re:.*embed_tokens$', 're:.*o_proj$', 're:.*down_proj$']
27
+ location: weight_output
28
+ inverse: false
29
+ ignore: []
30
+ - targets: ['re:.*q_proj$', 're:.*k_proj$', 're:.*v_proj$', 're:.*up_proj$', 're:.*gate_proj$',
31
+ lm_head]
32
+ location: weight_input
33
+ inverse: true
34
+ ignore: []
35
+ randomize: false
36
+ requires_grad: false
37
+ head_dim: 128
38
+ precision: torch.float64
39
+ R2:
40
+ type: hadamard
41
+ apply:
42
+ - targets: ['re:.*v_proj$']
43
+ location: weight_output
44
+ inverse: false
45
+ ignore: []
46
+ - targets: ['re:.*o_proj$']
47
+ location: weight_input
48
+ inverse: true
49
+ ignore: []
50
+ randomize: false
51
+ requires_grad: false
52
+ head_dim: 128
53
+ precision: torch.float64
54
+ GPTQModifier:
55
+ config_groups:
56
+ group_0:
57
+ targets: [Linear]
58
+ weights:
59
+ num_bits: 8
60
+ type: int
61
+ symmetric: true
62
+ group_size: null
63
+ strategy: tensor
64
+ block_structure: null
65
+ dynamic: false
66
+ actorder: !!python/object/apply:compressed_tensors.quantization.quant_args.ActivationOrdering [
67
+ static]
68
+ scale_dtype: null
69
+ zp_dtype: null
70
+ observer: memoryless_minmax
71
+ observer_kwargs: {}
72
+ input_activations:
73
+ num_bits: 8
74
+ type: int
75
+ symmetric: true
76
+ group_size: null
77
+ strategy: tensor
78
+ block_structure: null
79
+ dynamic: false
80
+ actorder: null
81
+ scale_dtype: null
82
+ zp_dtype: null
83
+ observer: memoryless_minmax
84
+ observer_kwargs: {}
85
+ output_activations: null
86
+ format: null
87
+ targets: [Linear]
88
+ ignore: [lm_head]
89
+ bypass_divisibility_checks: false
90
+ block_size: 128
91
+ dampening_frac: 0.01
92
+ actorder: static
93
+ offload_hessians: false
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b9e4e7fb171f92fd137b777cc2714bf87d11576700a1dcd7a399e7bbe39537b
3
+ size 17209920
tokenizer_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<|begin_of_text|>",
4
+ "clean_up_tokenization_spaces": true,
5
+ "eos_token": "<|eot_id|>",
6
+ "is_local": false,
7
+ "local_files_only": false,
8
+ "model_input_names": [
9
+ "input_ids",
10
+ "attention_mask"
11
+ ],
12
+ "model_max_length": 131072,
13
+ "tokenizer_class": "TokenizersBackend"
14
+ }