Update model
Browse files- README.md +116 -171
- config.json +6 -3
- generation_config.json +0 -6
- model.safetensors +2 -2
- tokenizer.json +0 -0
- tokenizer_config.json +8 -0
README.md
CHANGED
@@ -1,170 +1,72 @@
|
|
1 |
---
|
2 |
language:
|
3 |
-
- en
|
4 |
license: apache-2.0
|
5 |
base_model: Locutusque/TinyMistral-248M
|
6 |
datasets:
|
7 |
-
- HuggingFaceH4/ultrachat_200k
|
8 |
-
- Felladrin/ChatML-ultrachat_200k
|
9 |
-
- Open-Orca/OpenOrca
|
10 |
-
- Felladrin/ChatML-OpenOrca
|
11 |
-
- hkust-nlp/deita-10k-v0
|
12 |
-
- Felladrin/ChatML-deita-10k-v0
|
13 |
-
- LDJnr/Capybara
|
14 |
-
- Felladrin/ChatML-Capybara
|
15 |
-
- databricks/databricks-dolly-15k
|
16 |
-
- Felladrin/ChatML-databricks-dolly-15k
|
17 |
-
- euclaise/reddit-instruct-curated
|
18 |
-
- Felladrin/ChatML-reddit-instruct-curated
|
19 |
-
- CohereForAI/aya_dataset
|
20 |
-
- Felladrin/ChatML-aya_dataset
|
|
|
21 |
pipeline_tag: text-generation
|
22 |
widget:
|
23 |
-
- messages:
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
|
|
|
|
|
|
57 |
inference:
|
58 |
parameters:
|
59 |
max_new_tokens: 250
|
60 |
penalty_alpha: 0.5
|
61 |
top_k: 5
|
62 |
-
model-index:
|
63 |
-
- name: TinyMistral-248M-Chat-v2
|
64 |
-
results:
|
65 |
-
- task:
|
66 |
-
type: text-generation
|
67 |
-
name: Text Generation
|
68 |
-
dataset:
|
69 |
-
name: AI2 Reasoning Challenge (25-Shot)
|
70 |
-
type: ai2_arc
|
71 |
-
config: ARC-Challenge
|
72 |
-
split: test
|
73 |
-
args:
|
74 |
-
num_few_shot: 25
|
75 |
-
metrics:
|
76 |
-
- type: acc_norm
|
77 |
-
value: 23.29
|
78 |
-
name: normalized accuracy
|
79 |
-
source:
|
80 |
-
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Felladrin/TinyMistral-248M-Chat-v2
|
81 |
-
name: Open LLM Leaderboard
|
82 |
-
- task:
|
83 |
-
type: text-generation
|
84 |
-
name: Text Generation
|
85 |
-
dataset:
|
86 |
-
name: HellaSwag (10-Shot)
|
87 |
-
type: hellaswag
|
88 |
-
split: validation
|
89 |
-
args:
|
90 |
-
num_few_shot: 10
|
91 |
-
metrics:
|
92 |
-
- type: acc_norm
|
93 |
-
value: 27.39
|
94 |
-
name: normalized accuracy
|
95 |
-
source:
|
96 |
-
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Felladrin/TinyMistral-248M-Chat-v2
|
97 |
-
name: Open LLM Leaderboard
|
98 |
-
- task:
|
99 |
-
type: text-generation
|
100 |
-
name: Text Generation
|
101 |
-
dataset:
|
102 |
-
name: MMLU (5-Shot)
|
103 |
-
type: cais/mmlu
|
104 |
-
config: all
|
105 |
-
split: test
|
106 |
-
args:
|
107 |
-
num_few_shot: 5
|
108 |
-
metrics:
|
109 |
-
- type: acc
|
110 |
-
value: 23.52
|
111 |
-
name: accuracy
|
112 |
-
source:
|
113 |
-
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Felladrin/TinyMistral-248M-Chat-v2
|
114 |
-
name: Open LLM Leaderboard
|
115 |
-
- task:
|
116 |
-
type: text-generation
|
117 |
-
name: Text Generation
|
118 |
-
dataset:
|
119 |
-
name: TruthfulQA (0-shot)
|
120 |
-
type: truthful_qa
|
121 |
-
config: multiple_choice
|
122 |
-
split: validation
|
123 |
-
args:
|
124 |
-
num_few_shot: 0
|
125 |
-
metrics:
|
126 |
-
- type: mc2
|
127 |
-
value: 41.32
|
128 |
-
source:
|
129 |
-
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Felladrin/TinyMistral-248M-Chat-v2
|
130 |
-
name: Open LLM Leaderboard
|
131 |
-
- task:
|
132 |
-
type: text-generation
|
133 |
-
name: Text Generation
|
134 |
-
dataset:
|
135 |
-
name: Winogrande (5-shot)
|
136 |
-
type: winogrande
|
137 |
-
config: winogrande_xl
|
138 |
-
split: validation
|
139 |
-
args:
|
140 |
-
num_few_shot: 5
|
141 |
-
metrics:
|
142 |
-
- type: acc
|
143 |
-
value: 49.01
|
144 |
-
name: accuracy
|
145 |
-
source:
|
146 |
-
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Felladrin/TinyMistral-248M-Chat-v2
|
147 |
-
name: Open LLM Leaderboard
|
148 |
-
- task:
|
149 |
-
type: text-generation
|
150 |
-
name: Text Generation
|
151 |
-
dataset:
|
152 |
-
name: GSM8k (5-shot)
|
153 |
-
type: gsm8k
|
154 |
-
config: main
|
155 |
-
split: test
|
156 |
-
args:
|
157 |
-
num_few_shot: 5
|
158 |
-
metrics:
|
159 |
-
- type: acc
|
160 |
-
value: 0.0
|
161 |
-
name: accuracy
|
162 |
-
source:
|
163 |
-
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Felladrin/TinyMistral-248M-Chat-v2
|
164 |
-
name: Open LLM Leaderboard
|
165 |
---
|
166 |
|
167 |
-
#
|
168 |
|
169 |
- Base model: [Locutusque/TinyMistral-248M](https://huggingface.co/Locutusque/TinyMistral-248M) with two additional special tokens (`<|im_start|>` and `<|im_end|>`)
|
170 |
- Datasets:
|
@@ -175,10 +77,8 @@ model-index:
|
|
175 |
- [[ChatML](https://huggingface.co/datasets/Felladrin/ChatML-databricks-dolly-15k)] [databricks/databricks-dolly-15k](https://huggingface.co/datasets/databricks/databricks-dolly-15k)
|
176 |
- [[ChatML](https://huggingface.co/datasets/Felladrin/ChatML-reddit-instruct-curated)] [euclaise/reddit-instruct-curated](https://huggingface.co/datasets/euclaise/reddit-instruct-curated)
|
177 |
- [[ChatML](https://huggingface.co/datasets/Felladrin/ChatML-aya_dataset)] [CohereForAI/aya_dataset](https://huggingface.co/datasets/CohereForAI/aya_dataset)
|
178 |
-
-
|
179 |
-
-
|
180 |
-
- GGUF: [Felladrin/gguf-TinyMistral-248M-Chat-v2](https://huggingface.co/Felladrin/gguf-TinyMistral-248M-Chat-v2)
|
181 |
-
- ONNX: [Felladrin/onnx-TinyMistral-248M-Chat-v2](https://huggingface.co/Felladrin/onnx-TinyMistral-248M-Chat-v2)
|
182 |
|
183 |
## Recommended Prompt Format
|
184 |
|
@@ -202,7 +102,7 @@ top_k: 5
|
|
202 |
```python
|
203 |
from transformers import pipeline
|
204 |
|
205 |
-
generate = pipeline("text-generation", "Felladrin/TinyMistral-248M-Chat-
|
206 |
|
207 |
messages = [
|
208 |
{
|
@@ -251,16 +151,61 @@ This model was trained with [SFTTrainer](https://huggingface.co/docs/trl/main/en
|
|
251 |
| Scheduler | cosine |
|
252 |
| Seed | 42 |
|
253 |
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
|
259 |
-
|
260 |
-
|
|
261 |
-
|
|
262 |
-
|
|
263 |
-
|
|
264 |
-
|
|
265 |
-
|
|
266 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
language:
|
3 |
+
- en
|
4 |
license: apache-2.0
|
5 |
base_model: Locutusque/TinyMistral-248M
|
6 |
datasets:
|
7 |
+
- HuggingFaceH4/ultrachat_200k
|
8 |
+
- Felladrin/ChatML-ultrachat_200k
|
9 |
+
- Open-Orca/OpenOrca
|
10 |
+
- Felladrin/ChatML-OpenOrca
|
11 |
+
- hkust-nlp/deita-10k-v0
|
12 |
+
- Felladrin/ChatML-deita-10k-v0
|
13 |
+
- LDJnr/Capybara
|
14 |
+
- Felladrin/ChatML-Capybara
|
15 |
+
- databricks/databricks-dolly-15k
|
16 |
+
- Felladrin/ChatML-databricks-dolly-15k
|
17 |
+
- euclaise/reddit-instruct-curated
|
18 |
+
- Felladrin/ChatML-reddit-instruct-curated
|
19 |
+
- CohereForAI/aya_dataset
|
20 |
+
- Felladrin/ChatML-aya_dataset
|
21 |
+
- HuggingFaceH4/ultrafeedback_binarized
|
22 |
pipeline_tag: text-generation
|
23 |
widget:
|
24 |
+
- messages:
|
25 |
+
- role: system
|
26 |
+
content:
|
27 |
+
You are a highly knowledgeable and friendly assistant. Your goal is to
|
28 |
+
understand and respond to user inquiries with clarity. Your interactions are
|
29 |
+
always respectful, helpful, and focused on delivering the most accurate information
|
30 |
+
to the user.
|
31 |
+
- role: user
|
32 |
+
content: Hey! Got a question for you!
|
33 |
+
- role: assistant
|
34 |
+
content: Sure! What's it?
|
35 |
+
- role: user
|
36 |
+
content: What are some potential applications for quantum computing?
|
37 |
+
- messages:
|
38 |
+
- role: user
|
39 |
+
content: Heya!
|
40 |
+
- role: assistant
|
41 |
+
content: Hi! How may I help you?
|
42 |
+
- role: user
|
43 |
+
content:
|
44 |
+
I'm interested in developing a career in software engineering. What would
|
45 |
+
you recommend me to do?
|
46 |
+
- messages:
|
47 |
+
- role: user
|
48 |
+
content: Morning!
|
49 |
+
- role: assistant
|
50 |
+
content: Good morning! How can I help you today?
|
51 |
+
- role: user
|
52 |
+
content: Could you give me some tips for becoming a healthier person?
|
53 |
+
- messages:
|
54 |
+
- role: system
|
55 |
+
content:
|
56 |
+
You are a very creative assistant. User will give you a task, which you
|
57 |
+
should complete with all your knowledge.
|
58 |
+
- role: user
|
59 |
+
content:
|
60 |
+
Hello! Can you please elaborate a background story of an RPG game about
|
61 |
+
wizards and dragons in a sci-fi world?
|
62 |
inference:
|
63 |
parameters:
|
64 |
max_new_tokens: 250
|
65 |
penalty_alpha: 0.5
|
66 |
top_k: 5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
---
|
68 |
|
69 |
+
# TinyMistral-248M-Chat
|
70 |
|
71 |
- Base model: [Locutusque/TinyMistral-248M](https://huggingface.co/Locutusque/TinyMistral-248M) with two additional special tokens (`<|im_start|>` and `<|im_end|>`)
|
72 |
- Datasets:
|
|
|
77 |
- [[ChatML](https://huggingface.co/datasets/Felladrin/ChatML-databricks-dolly-15k)] [databricks/databricks-dolly-15k](https://huggingface.co/datasets/databricks/databricks-dolly-15k)
|
78 |
- [[ChatML](https://huggingface.co/datasets/Felladrin/ChatML-reddit-instruct-curated)] [euclaise/reddit-instruct-curated](https://huggingface.co/datasets/euclaise/reddit-instruct-curated)
|
79 |
- [[ChatML](https://huggingface.co/datasets/Felladrin/ChatML-aya_dataset)] [CohereForAI/aya_dataset](https://huggingface.co/datasets/CohereForAI/aya_dataset)
|
80 |
+
- [HuggingFaceH4/ultrafeedback_binarized](https://huggingface.co/datasets/HuggingFaceH4/ultrafeedback_binarized)
|
81 |
+
- License: [Apache License 2.0](https://huggingface.co/Felladrin/TinyMistral-248M-Chat-v3/resolve/main/license.txt)
|
|
|
|
|
82 |
|
83 |
## Recommended Prompt Format
|
84 |
|
|
|
102 |
```python
|
103 |
from transformers import pipeline
|
104 |
|
105 |
+
generate = pipeline("text-generation", "Felladrin/TinyMistral-248M-Chat-v3")
|
106 |
|
107 |
messages = [
|
108 |
{
|
|
|
151 |
| Scheduler | cosine |
|
152 |
| Seed | 42 |
|
153 |
|
154 |
+
Then, the model was fine-tuned with DPO through [LLaMA-Factory](https://github.com/hiyouga/LLaMA-Factory) using the following hyperparameters and command:
|
155 |
+
|
156 |
+
| Parameter | Value |
|
157 |
+
| :-------------------------- | :------------------------------------------------------------------------------------------------------------- |
|
158 |
+
| Dataset | [HuggingFaceH4/ultrafeedback_binarized](https://huggingface.co/datasets/HuggingFaceH4/ultrafeedback_binarized) |
|
159 |
+
| Learning rate | 1e-06 |
|
160 |
+
| Train batch size | 4 |
|
161 |
+
| Eval batch size | 8 |
|
162 |
+
| Seed | 42 |
|
163 |
+
| Distributed type | multi-GPU |
|
164 |
+
| Number of devices | 8 |
|
165 |
+
| Gradient accumulation steps | 4 |
|
166 |
+
| Total train batch size | 128 |
|
167 |
+
| Total eval batch size | 64 |
|
168 |
+
| Optimizer | adamw_8bit with betas=(0.9,0.999) and epsilon=1e-08 |
|
169 |
+
| LR scheduler type | cosine |
|
170 |
+
| LR scheduler warmup ratio | 0.1 |
|
171 |
+
| Number of epochs | 2.0 |
|
172 |
+
|
173 |
+
```sh
|
174 |
+
llamafactory-cli train \
|
175 |
+
--stage dpo \
|
176 |
+
--do_train True \
|
177 |
+
--model_name_or_path ~/TinyMistral-248M-Chat \
|
178 |
+
--preprocessing_num_workers $(python -c "import os; print(max(1, os.cpu_count() - 2))") \
|
179 |
+
--dataloader_num_workers $(python -c "import os; print(max(1, os.cpu_count() - 2))") \
|
180 |
+
--finetuning_type full \
|
181 |
+
--template default \
|
182 |
+
--flash_attn auto \
|
183 |
+
--enable_liger_kernel True \
|
184 |
+
--dataset_dir data \
|
185 |
+
--dataset ultrafeedback \
|
186 |
+
--cutoff_len 1024 \
|
187 |
+
--learning_rate 1e-6 \
|
188 |
+
--num_train_epochs 2.0 \
|
189 |
+
--per_device_train_batch_size 4 \
|
190 |
+
--gradient_accumulation_steps 4 \
|
191 |
+
--lr_scheduler_type cosine \
|
192 |
+
--max_grad_norm 1.0 \
|
193 |
+
--logging_steps 10 \
|
194 |
+
--save_steps 50 \
|
195 |
+
--save_total_limit 1 \
|
196 |
+
--warmup_ratio 0.1 \
|
197 |
+
--packing False \
|
198 |
+
--report_to none \
|
199 |
+
--output_dir ~/TinyMistral-248M-Chat-v3 \
|
200 |
+
--pure_bf16 True \
|
201 |
+
--plot_loss True \
|
202 |
+
--trust_remote_code True \
|
203 |
+
--ddp_timeout 180000000 \
|
204 |
+
--include_tokens_per_second True \
|
205 |
+
--include_num_input_tokens_seen True \
|
206 |
+
--optim adamw_8bit \
|
207 |
+
--pref_beta 0.5 \
|
208 |
+
--pref_ftx 0 \
|
209 |
+
--pref_loss simpo \
|
210 |
+
--gradient_checkpointing True
|
211 |
+
```
|
config.json
CHANGED
@@ -1,8 +1,10 @@
|
|
1 |
{
|
|
|
2 |
"architectures": ["MistralForCausalLM"],
|
3 |
"attention_dropout": 0.0,
|
4 |
"bos_token_id": 32000,
|
5 |
"eos_token_id": 32003,
|
|
|
6 |
"hidden_act": "silu",
|
7 |
"hidden_size": 1024,
|
8 |
"initializer_range": 0.02,
|
@@ -14,10 +16,11 @@
|
|
14 |
"num_key_value_heads": 8,
|
15 |
"rms_norm_eps": 1e-6,
|
16 |
"rope_theta": 10000.0,
|
17 |
-
"sliding_window":
|
18 |
"tie_word_embeddings": false,
|
19 |
-
"torch_dtype": "
|
20 |
-
"transformers_version": "4.
|
21 |
"use_cache": true,
|
|
|
22 |
"vocab_size": 32005
|
23 |
}
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "Felladrin/TinyMistral-248M-Chat-v3",
|
3 |
"architectures": ["MistralForCausalLM"],
|
4 |
"attention_dropout": 0.0,
|
5 |
"bos_token_id": 32000,
|
6 |
"eos_token_id": 32003,
|
7 |
+
"head_dim": 32,
|
8 |
"hidden_act": "silu",
|
9 |
"hidden_size": 1024,
|
10 |
"initializer_range": 0.02,
|
|
|
16 |
"num_key_value_heads": 8,
|
17 |
"rms_norm_eps": 1e-6,
|
18 |
"rope_theta": 10000.0,
|
19 |
+
"sliding_window": null,
|
20 |
"tie_word_embeddings": false,
|
21 |
+
"torch_dtype": "bfloat16",
|
22 |
+
"transformers_version": "4.49.0",
|
23 |
"use_cache": true,
|
24 |
+
"use_sliding_window": false,
|
25 |
"vocab_size": 32005
|
26 |
}
|
generation_config.json
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"_from_model_config": true,
|
3 |
-
"bos_token_id": 32000,
|
4 |
-
"eos_token_id": 32003,
|
5 |
-
"transformers_version": "4.38.2"
|
6 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ddf0ded71ab5a315f90bc932d018a2b20e81987f49f8c9c6efcaf612b2d5a4d6
|
3 |
+
size 496060688
|
tokenizer.json
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
{
|
2 |
"add_bos_token": false,
|
3 |
"add_eos_token": false,
|
|
|
4 |
"added_tokens_decoder": {
|
5 |
"0": {
|
6 |
"content": "<unk>",
|
@@ -72,12 +73,19 @@
|
|
72 |
"chat_template": "{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
|
73 |
"clean_up_tokenization_spaces": false,
|
74 |
"eos_token": "<|im_end|>",
|
|
|
75 |
"legacy": true,
|
|
|
76 |
"model_max_length": 2048,
|
77 |
"pad_token": "[PAD]",
|
|
|
78 |
"sp_model_kwargs": {},
|
79 |
"spaces_between_special_tokens": false,
|
|
|
|
|
80 |
"tokenizer_class": "LlamaTokenizer",
|
|
|
|
|
81 |
"unk_token": "<unk>",
|
82 |
"use_default_system_prompt": false
|
83 |
}
|
|
|
1 |
{
|
2 |
"add_bos_token": false,
|
3 |
"add_eos_token": false,
|
4 |
+
"add_prefix_space": null,
|
5 |
"added_tokens_decoder": {
|
6 |
"0": {
|
7 |
"content": "<unk>",
|
|
|
73 |
"chat_template": "{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
|
74 |
"clean_up_tokenization_spaces": false,
|
75 |
"eos_token": "<|im_end|>",
|
76 |
+
"extra_special_tokens": {},
|
77 |
"legacy": true,
|
78 |
+
"max_length": 2048,
|
79 |
"model_max_length": 2048,
|
80 |
"pad_token": "[PAD]",
|
81 |
+
"padding_side": "right",
|
82 |
"sp_model_kwargs": {},
|
83 |
"spaces_between_special_tokens": false,
|
84 |
+
"split_special_tokens": false,
|
85 |
+
"stride": 0,
|
86 |
"tokenizer_class": "LlamaTokenizer",
|
87 |
+
"truncation_side": "right",
|
88 |
+
"truncation_strategy": "longest_first",
|
89 |
"unk_token": "<unk>",
|
90 |
"use_default_system_prompt": false
|
91 |
}
|