ericflo commited on
Commit
b06e97f
·
verified ·
1 Parent(s): 4569275

Upload folder using huggingface_hub

Browse files
Llama-3.2-3B-COTv2.2-BF16.gguf CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7f33810ea6aee3320f740f6ee9eafca837f1fb761643f4dffea0917beeab3879
3
- size 6433688640
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:14f62673e18f033e54628c138aef5c7b58f57ad8411c1a51bd766a4b3009a856
3
+ size 6433688608
Llama-3.2-3B-COTv2.2-F32.gguf CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:1cf1e8ae4bc683b388d1a6f9b74bde514b401ab46179ccfddb436dd2b2d5e2cc
3
- size 12858838080
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d6fb60eab52f0cd2d38241c8dd249825dbc950faf0c9bf2e959ab136089e8e2
3
+ size 12858838048
Llama-3.2-3B-COTv2.2-Q4_K_M.gguf CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:14fda3dd47211f5f8fcbf8cdc148e58cdd866cd7bc20df34e7dae5a217e878f9
3
- size 2019378240
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3e7751cd05a31fa44aaab3d3f65e6f8d331d276e597eb7a9f9bbf862c5e093b6
3
+ size 2019378208
Llama-3.2-3B-COTv2.2-Q6_K.gguf CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a5f5c773b8a9404cfbade1cb369a70a5a7fbd5aa4af65782dea9bd9c8bd1bbd1
3
- size 2643854400
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7c0b9cd99bbfb18ee50481c5f622bb4bad3b13cef5eb49c0d6b17ccaa89e74f7
3
+ size 2643854368
Llama-3.2-3B-COTv2.2-Q8_0.gguf CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2601bbcb54f09347afbd092b08fc0985a69d351635966e69d0c7e9752c8f6072
3
- size 3421899840
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7454e6280750b05c94c368942cd47369f8e77b8a1b96ed98dcb9e8146057e8f6
3
+ size 3421899808
README.md CHANGED
@@ -1,120 +1,51 @@
1
  ---
2
- license: apache-2.0
3
  base_model:
4
  - meta-llama/Llama-3.2-3B-Instruct
 
 
 
5
  library_name: transformers
6
- datasets:
7
- - ericflo/Llama-3.2-3B-COT
8
- ---
9
- # Thought-Ranked Llama 3.2 3B v2.2
10
-
11
- ## What's New in v2?
12
-
13
- The biggest improvement in v2 is how the model thinks through problems. Instead of just one level of thoughts, it can now explore up to 6 levels deep, building on its best ideas at each step. Think of it like having a conversation with yourself, where each new thought builds on your previous best insight.
14
-
15
- ## How It Works
16
-
17
- Let's look at an example. When asked "What would happen if the moon disappeared?", the model might think:
18
-
19
- ```
20
- <thoughts>
21
- <thought>First, I should consider the moon's main effects on Earth</thought>
22
- <thought>The moon controls our tides, so ocean patterns would change dramatically</thought>
23
- <thought>Without the moon's gravitational pull, Earth's rotation would become unstable</thought>
24
- <thought>This would lead to extreme climate changes and disrupted ecosystems</thought>
25
- <thought>The loss of moonlight would affect nocturnal animals and human culture</thought>
26
- <thought>Combining all these effects, we'd see a cascade of environmental changes</thought>
27
- </thoughts>
28
-
29
- The disappearance of the moon would have far-reaching consequences for Earth...
30
- [detailed answer follows]
31
- ```
32
-
33
- ### System Messages
34
-
35
- The model responds to different types of system prompts. Here are some examples:
36
-
37
- 1. Basic prompt:
38
- ```
39
- {"role": "system", "content": "You are a helpful assistant. Think before responding."}
40
- ```
41
-
42
- 2. Specific thought count:
43
- ```
44
- {"role": "system", "content": "You are a helpful assistant. Think 3 thoughts before responding."}
45
- ```
46
 
47
- 3. Standard helper:
48
- ```
49
- {"role": "system", "content": "You are a helpful assistant."}
50
- ```
51
-
52
- About 40% of training examples include system messages, and 75% of those specifically mention thinking. This helps the model learn when and how much to think through problems.
53
-
54
- ## Technical Details
55
-
56
- - **Base Model**: Llama 3.2 3B
57
- - **Training Data**: 2,500 carefully selected examples, each with up to 6 levels of thought chains
58
- - **Thought Selection**: At each level, the model generates multiple possible thoughts and picks the best one using an external ranking system
59
-
60
- ## What's It Good For?
61
-
62
- This model excels at tasks that benefit from careful thinking:
63
-
64
- ✅ Breaking down complex problems
65
- ✅ Step-by-step math solutions
66
- ✅ Detailed analysis of situations
67
- ✅ Explaining complicated concepts
68
- ✅ Making well-reasoned decisions
69
-
70
- ## Limitations
71
-
72
- - Can sometimes overthink simple problems
73
- - Limited by the capabilities of the base Llama 3.2 3B model
74
- - Not suitable for critical decisions without human oversight
75
- - May occasionally generate irrelevant thought chains
76
 
77
- ## Example Usage
78
 
79
- ```python
80
- from transformers import AutoModelForCausalLM, AutoTokenizer
81
 
82
- model = AutoModelForCausalLM.from_pretrained("ericflo/Llama-3.2-3B-COT-v2.2")
83
- tokenizer = AutoTokenizer.from_pretrained("ericflo/Llama-3.2-3B-COT-v2.2")
84
 
85
- messages = [
86
- {"role": "system", "content": "You are a helpful assistant. Think 3 thoughts before responding."},
87
- {"role": "user", "content": "How would you teach a child to ride a bike?"}
88
- ]
89
 
90
- input_ids = tokenizer.apply_chat_template(messages, return_tensors="pt")
91
- output = model.generate(input_ids, temperature=1.0)
92
- response = tokenizer.decode(output[0])
93
- ```
 
94
 
95
- Example output:
96
- ```
97
- <thoughts>
98
- <thought>Safety should be the first priority - helmet and protective gear</thought>
99
- <thought>Starting with balance using training wheels can build confidence</thought>
100
- <thought>Breaking the process into small, manageable steps will help avoid overwhelm</thought>
101
- </thoughts>
102
 
103
- Here's how I would teach a child to ride a bike...
104
- [detailed answer follows]
105
- ```
106
 
107
- ## Citation
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
 
109
- ```bibtex
110
- @misc{thought-ranked-llama-v2,
111
- title={Thought-Ranked Llama 3.2 v2: Hierarchical Chain-of-Thought Generation},
112
- author={[Eric Florenzano]},
113
- year={2024},
114
- howpublished={\url{https://huggingface.co/ericflo/Llama-3.2-3B-COT-v2}}
115
- }
116
  ```
117
-
118
- ## Acknowledgments
119
-
120
- This model builds on the Llama 3.2 3B base model from Meta. Special thanks to the open-source AI community for their contributions to chain-of-thought prompting techniques.
 
1
  ---
 
2
  base_model:
3
  - meta-llama/Llama-3.2-3B-Instruct
4
+ - ericflo/Llama-3.2-3B-COTv2.1
5
+ - ericflo/Llama-3.2-3B-MultiCOT
6
+ - ericflo/Llama-3.2-3B-COTv2
7
  library_name: transformers
8
+ tags:
9
+ - mergekit
10
+ - merge
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
+ ---
13
+ # Llama-3.2-3B-COTv2.2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
+ This is a merge of pre-trained language models created using [mergekit](https://github.com/cg123/mergekit).
16
 
17
+ ## Merge Details
18
+ ### Merge Method
19
 
20
+ This model was merged using the [linear](https://arxiv.org/abs/2203.05482) merge method.
 
21
 
22
+ ### Models Merged
 
 
 
23
 
24
+ The following models were included in the merge:
25
+ * [meta-llama/Llama-3.2-3B-Instruct](https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct)
26
+ * [ericflo/Llama-3.2-3B-COTv2.1](https://huggingface.co/ericflo/Llama-3.2-3B-COTv2.1)
27
+ * [ericflo/Llama-3.2-3B-MultiCOT](https://huggingface.co/ericflo/Llama-3.2-3B-MultiCOT)
28
+ * [ericflo/Llama-3.2-3B-COTv2](https://huggingface.co/ericflo/Llama-3.2-3B-COTv2)
29
 
30
+ ### Configuration
 
 
 
 
 
 
31
 
32
+ The following YAML configuration was used to produce this model:
 
 
33
 
34
+ ```yaml
35
+ models:
36
+ - model: meta-llama/Llama-3.2-3B-Instruct
37
+ parameters:
38
+ weight: 0.4
39
+ - model: ericflo/Llama-3.2-3B-COTv2
40
+ parameters:
41
+ weight: 1.0
42
+ - model: ericflo/Llama-3.2-3B-COTv2.1
43
+ parameters:
44
+ weight: 0.4
45
+ - model: ericflo/Llama-3.2-3B-MultiCOT
46
+ parameters:
47
+ weight: 0.3
48
+ merge_method: linear
49
+ dtype: bfloat16
50
 
 
 
 
 
 
 
 
51
  ```
 
 
 
 
config.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "_name_or_path": "ericflo/Llama-3.2-3B-MultiCOT",
3
  "architectures": [
4
  "LlamaForCausalLM"
5
  ],
 
1
  {
2
+ "_name_or_path": "meta-llama/Llama-3.2-3B-Instruct",
3
  "architectures": [
4
  "LlamaForCausalLM"
5
  ],
mergekit_config.yml CHANGED
@@ -1,10 +1,10 @@
1
  models:
2
  - model: meta-llama/Llama-3.2-3B-Instruct
3
  parameters:
4
- weight: 0.8
5
  - model: ericflo/Llama-3.2-3B-COTv2
6
  parameters:
7
- weight: 0.8
8
  - model: ericflo/Llama-3.2-3B-COTv2.1
9
  parameters:
10
  weight: 0.4
@@ -12,4 +12,4 @@ models:
12
  parameters:
13
  weight: 0.3
14
  merge_method: linear
15
- dtype: bfloat16
 
1
  models:
2
  - model: meta-llama/Llama-3.2-3B-Instruct
3
  parameters:
4
+ weight: 0.4
5
  - model: ericflo/Llama-3.2-3B-COTv2
6
  parameters:
7
+ weight: 1.0
8
  - model: ericflo/Llama-3.2-3B-COTv2.1
9
  parameters:
10
  weight: 0.4
 
12
  parameters:
13
  weight: 0.3
14
  merge_method: linear
15
+ dtype: bfloat16
model-00001-of-00002.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f078491908393f4a65b2a90de0ee42204062c634525a793e3ede365dee504b80
3
  size 4990977384
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4119e662a63df2f38d5d30442fae0efe2acd13affee46fd9aebdf77d02f6fa8a
3
  size 4990977384
model-00002-of-00002.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9a109c1c8571647be64d304a73aac48836e9d92d87b691cc9e8807bfd014fb26
3
  size 1434551664
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:99d363d12652ec3e6f2bf698d316cc26d7dd3418a4de26c6e55450e4aa972961
3
  size 1434551664
special_tokens_map.json CHANGED
@@ -12,12 +12,5 @@
12
  "normalized": false,
13
  "rstrip": false,
14
  "single_word": false
15
- },
16
- "pad_token": {
17
- "content": "<|eot_id|>",
18
- "lstrip": false,
19
- "normalized": false,
20
- "rstrip": false,
21
- "single_word": false
22
  }
23
  }
 
12
  "normalized": false,
13
  "rstrip": false,
14
  "single_word": false
 
 
 
 
 
 
 
15
  }
16
  }
tokenizer.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e9c4b74af81ca7d09faa23cc737405515f00d04de25d9ea1908153684b67d1c0
3
- size 17210020
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b9e4e7fb171f92fd137b777cc2714bf87d11576700a1dcd7a399e7bbe39537b
3
+ size 17209920
tokenizer_config.json CHANGED
@@ -2053,15 +2053,10 @@
2053
  "chat_template": "{{- bos_token }}\n{%- if custom_tools is defined %}\n {%- set tools = custom_tools %}\n{%- endif %}\n{%- if not tools_in_user_message is defined %}\n {%- set tools_in_user_message = true %}\n{%- endif %}\n{%- if not date_string is defined %}\n {%- if strftime_now is defined %}\n {%- set date_string = strftime_now(\"%d %b %Y\") %}\n {%- else %}\n {%- set date_string = \"26 Jul 2024\" %}\n {%- endif %}\n{%- endif %}\n{%- if not tools is defined %}\n {%- set tools = none %}\n{%- endif %}\n\n{#- This block extracts the system message, so we can slot it into the right place. #}\n{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content']|trim %}\n {%- set messages = messages[1:] %}\n{%- else %}\n {%- set system_message = \"\" %}\n{%- endif %}\n\n{#- System message #}\n{{- \"<|start_header_id|>system<|end_header_id|>\\n\\n\" }}\n{%- if tools is not none %}\n {{- \"Environment: ipython\\n\" }}\n{%- endif %}\n{{- \"Cutting Knowledge Date: December 2023\\n\" }}\n{{- \"Today Date: \" + date_string + \"\\n\\n\" }}\n{%- if tools is not none and not tools_in_user_message %}\n {{- \"You have access to the following functions. To call a function, please respond with JSON for a function call.\" }}\n {{- 'Respond in the format {\"name\": function name, \"parameters\": dictionary of argument name and its value}.' }}\n {{- \"Do not use variables.\\n\\n\" }}\n {%- for t in tools %}\n {{- t | tojson(indent=4) }}\n {{- \"\\n\\n\" }}\n {%- endfor %}\n{%- endif %}\n{{- system_message }}\n{{- \"<|eot_id|>\" }}\n\n{#- Custom tools are passed in a user message with some extra guidance #}\n{%- if tools_in_user_message and not tools is none %}\n {#- Extract the first user message so we can plug it in here #}\n {%- if messages | length != 0 %}\n {%- set first_user_message = messages[0]['content']|trim %}\n {%- set messages = messages[1:] %}\n {%- else %}\n {{- raise_exception(\"Cannot put tools in the first user message when there's no first user message!\") }}\n{%- endif %}\n {{- '<|start_header_id|>user<|end_header_id|>\\n\\n' -}}\n {{- \"Given the following functions, please respond with a JSON for a function call \" }}\n {{- \"with its proper arguments that best answers the given prompt.\\n\\n\" }}\n {{- 'Respond in the format {\"name\": function name, \"parameters\": dictionary of argument name and its value}.' }}\n {{- \"Do not use variables.\\n\\n\" }}\n {%- for t in tools %}\n {{- t | tojson(indent=4) }}\n {{- \"\\n\\n\" }}\n {%- endfor %}\n {{- first_user_message + \"<|eot_id|>\"}}\n{%- endif %}\n\n{%- for message in messages %}\n {%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}\n {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\\n\\n'+ message['content'] | trim + '<|eot_id|>' }}\n {%- elif 'tool_calls' in message %}\n {%- if not message.tool_calls|length == 1 %}\n {{- raise_exception(\"This model only supports single tool-calls at once!\") }}\n {%- endif %}\n {%- set tool_call = message.tool_calls[0].function %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' -}}\n {{- '{\"name\": \"' + tool_call.name + '\", ' }}\n {{- '\"parameters\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- \"}\" }}\n {{- \"<|eot_id|>\" }}\n {%- elif message.role == \"tool\" or message.role == \"ipython\" %}\n {{- \"<|start_header_id|>ipython<|end_header_id|>\\n\\n\" }}\n {%- if message.content is mapping or message.content is iterable %}\n {{- message.content | tojson }}\n {%- else %}\n {{- message.content }}\n {%- endif %}\n {{- \"<|eot_id|>\" }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' }}\n{%- endif %}\n",
2054
  "clean_up_tokenization_spaces": true,
2055
  "eos_token": "<|eot_id|>",
2056
- "max_length": 16384,
2057
  "model_input_names": [
2058
  "input_ids",
2059
  "attention_mask"
2060
  ],
2061
  "model_max_length": 131072,
2062
- "pad_token": "<|eot_id|>",
2063
- "stride": 0,
2064
- "tokenizer_class": "PreTrainedTokenizerFast",
2065
- "truncation_side": "right",
2066
- "truncation_strategy": "longest_first"
2067
  }
 
2053
  "chat_template": "{{- bos_token }}\n{%- if custom_tools is defined %}\n {%- set tools = custom_tools %}\n{%- endif %}\n{%- if not tools_in_user_message is defined %}\n {%- set tools_in_user_message = true %}\n{%- endif %}\n{%- if not date_string is defined %}\n {%- if strftime_now is defined %}\n {%- set date_string = strftime_now(\"%d %b %Y\") %}\n {%- else %}\n {%- set date_string = \"26 Jul 2024\" %}\n {%- endif %}\n{%- endif %}\n{%- if not tools is defined %}\n {%- set tools = none %}\n{%- endif %}\n\n{#- This block extracts the system message, so we can slot it into the right place. #}\n{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content']|trim %}\n {%- set messages = messages[1:] %}\n{%- else %}\n {%- set system_message = \"\" %}\n{%- endif %}\n\n{#- System message #}\n{{- \"<|start_header_id|>system<|end_header_id|>\\n\\n\" }}\n{%- if tools is not none %}\n {{- \"Environment: ipython\\n\" }}\n{%- endif %}\n{{- \"Cutting Knowledge Date: December 2023\\n\" }}\n{{- \"Today Date: \" + date_string + \"\\n\\n\" }}\n{%- if tools is not none and not tools_in_user_message %}\n {{- \"You have access to the following functions. To call a function, please respond with JSON for a function call.\" }}\n {{- 'Respond in the format {\"name\": function name, \"parameters\": dictionary of argument name and its value}.' }}\n {{- \"Do not use variables.\\n\\n\" }}\n {%- for t in tools %}\n {{- t | tojson(indent=4) }}\n {{- \"\\n\\n\" }}\n {%- endfor %}\n{%- endif %}\n{{- system_message }}\n{{- \"<|eot_id|>\" }}\n\n{#- Custom tools are passed in a user message with some extra guidance #}\n{%- if tools_in_user_message and not tools is none %}\n {#- Extract the first user message so we can plug it in here #}\n {%- if messages | length != 0 %}\n {%- set first_user_message = messages[0]['content']|trim %}\n {%- set messages = messages[1:] %}\n {%- else %}\n {{- raise_exception(\"Cannot put tools in the first user message when there's no first user message!\") }}\n{%- endif %}\n {{- '<|start_header_id|>user<|end_header_id|>\\n\\n' -}}\n {{- \"Given the following functions, please respond with a JSON for a function call \" }}\n {{- \"with its proper arguments that best answers the given prompt.\\n\\n\" }}\n {{- 'Respond in the format {\"name\": function name, \"parameters\": dictionary of argument name and its value}.' }}\n {{- \"Do not use variables.\\n\\n\" }}\n {%- for t in tools %}\n {{- t | tojson(indent=4) }}\n {{- \"\\n\\n\" }}\n {%- endfor %}\n {{- first_user_message + \"<|eot_id|>\"}}\n{%- endif %}\n\n{%- for message in messages %}\n {%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}\n {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\\n\\n'+ message['content'] | trim + '<|eot_id|>' }}\n {%- elif 'tool_calls' in message %}\n {%- if not message.tool_calls|length == 1 %}\n {{- raise_exception(\"This model only supports single tool-calls at once!\") }}\n {%- endif %}\n {%- set tool_call = message.tool_calls[0].function %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' -}}\n {{- '{\"name\": \"' + tool_call.name + '\", ' }}\n {{- '\"parameters\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- \"}\" }}\n {{- \"<|eot_id|>\" }}\n {%- elif message.role == \"tool\" or message.role == \"ipython\" %}\n {{- \"<|start_header_id|>ipython<|end_header_id|>\\n\\n\" }}\n {%- if message.content is mapping or message.content is iterable %}\n {{- message.content | tojson }}\n {%- else %}\n {{- message.content }}\n {%- endif %}\n {{- \"<|eot_id|>\" }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' }}\n{%- endif %}\n",
2054
  "clean_up_tokenization_spaces": true,
2055
  "eos_token": "<|eot_id|>",
 
2056
  "model_input_names": [
2057
  "input_ids",
2058
  "attention_mask"
2059
  ],
2060
  "model_max_length": 131072,
2061
+ "tokenizer_class": "PreTrainedTokenizerFast"
 
 
 
 
2062
  }