Suggested tokenizer changes by Unsloth.ai
#36
by
gugarosa - opened
- README.md +1 -3
- config.json +3 -2
- data_summary_card.md +0 -159
- generation_config.json +4 -2
- special_tokens_map.json +2 -2
- tokenizer_config.json +3 -3
README.md
CHANGED
|
@@ -172,6 +172,4 @@ Developers should apply responsible AI best practices and are responsible for en
|
|
| 172 |
|
| 173 |
* **Generation of Harmful Content:** Developers should assess outputs for their context and use available safety classifiers or custom solutions appropriate for their use case.
|
| 174 |
|
| 175 |
-
* **Misuse:** Other forms of misuse such as fraud, spam, or malware production may be possible, and developers should ensure that their applications do not violate applicable laws and regulations.
|
| 176 |
-
|
| 177 |
-
* **Data Summary:** https://huggingface.co/microsoft/phi-4/blob/main/data_summary_card.md
|
|
|
|
| 172 |
|
| 173 |
* **Generation of Harmful Content:** Developers should assess outputs for their context and use available safety classifiers or custom solutions appropriate for their use case.
|
| 174 |
|
| 175 |
+
* **Misuse:** Other forms of misuse such as fraud, spam, or malware production may be possible, and developers should ensure that their applications do not violate applicable laws and regulations.
|
|
|
|
|
|
config.json
CHANGED
|
@@ -5,9 +5,10 @@
|
|
| 5 |
],
|
| 6 |
"attention_bias": false,
|
| 7 |
"attention_dropout": 0.0,
|
|
|
|
| 8 |
"bos_token_id": 100257,
|
| 9 |
"embd_pdrop": 0.0,
|
| 10 |
-
"eos_token_id":
|
| 11 |
"hidden_act": "silu",
|
| 12 |
"hidden_size": 5120,
|
| 13 |
"initializer_range": 0.02,
|
|
@@ -18,7 +19,7 @@
|
|
| 18 |
"num_hidden_layers": 40,
|
| 19 |
"num_key_value_heads": 10,
|
| 20 |
"original_max_position_embeddings": 16384,
|
| 21 |
-
"pad_token_id":
|
| 22 |
"resid_pdrop": 0.0,
|
| 23 |
"rms_norm_eps": 1e-05,
|
| 24 |
"rope_scaling": null,
|
|
|
|
| 5 |
],
|
| 6 |
"attention_bias": false,
|
| 7 |
"attention_dropout": 0.0,
|
| 8 |
+
"auto_map": {},
|
| 9 |
"bos_token_id": 100257,
|
| 10 |
"embd_pdrop": 0.0,
|
| 11 |
+
"eos_token_id": 100257,
|
| 12 |
"hidden_act": "silu",
|
| 13 |
"hidden_size": 5120,
|
| 14 |
"initializer_range": 0.02,
|
|
|
|
| 19 |
"num_hidden_layers": 40,
|
| 20 |
"num_key_value_heads": 10,
|
| 21 |
"original_max_position_embeddings": 16384,
|
| 22 |
+
"pad_token_id": 100257,
|
| 23 |
"resid_pdrop": 0.0,
|
| 24 |
"rms_norm_eps": 1e-05,
|
| 25 |
"rope_scaling": null,
|
data_summary_card.md
DELETED
|
@@ -1,159 +0,0 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
# Data Summary for microsoft_phi-4
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
## 1. General information
|
| 10 |
-
|
| 11 |
-
**1.0.1 Version of the Summary:** 1.0
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
**1.0.2 Last update:** 24-Nov-2025
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
## 1.1 Model Developer Identification
|
| 20 |
-
|
| 21 |
-
**1.1.1 Model Developer name and contact details:** Microsoft Corporation at One Microsoft Way, Redmond, WA 98052. Tel: 425-882-8080
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
## 1.2 Model Identification
|
| 26 |
-
|
| 27 |
-
**1.2.1 Versioned model name(s):** phi-4
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
**1.2.2 Model release date:** 12-Dec-2024
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
## 1.3 Overall training data size and characteristics
|
| 36 |
-
|
| 37 |
-
### 1.3.1 Size of dataset and characteristics
|
| 38 |
-
|
| 39 |
-
**1.3.1.A Text training data size:** 1 billion to 10 trillion tokens
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
**1.3.1.B Text training data content:** Training data is an extension of the data used for Phi-3 and includes a wide variety of sources from:
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
1. Publicly available documents filtered rigorously for quality, selected high-quality educational data, and code.
|
| 48 |
-
|
| 49 |
-
2. Newly created synthetic, “textbook-like” data for the purpose of teaching math, coding, common sense reasoning, general knowledge of the world (science, daily activities, theory of mind, etc.).
|
| 50 |
-
|
| 51 |
-
3. Acquired academic books and Q&A datasets.
|
| 52 |
-
|
| 53 |
-
4. High quality chat format supervised data covering various topics to reflect human preferences on different aspects such as instruct-following, truthfulness, honesty and helpfulness.
|
| 54 |
-
|
| 55 |
-
5. Multilingual data constitutes about 8% of our overall data.
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
**1.3.1.C Image training data size:** Not applicable. Images are not part of the training
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
**1.3.1.D Image training data content:** Not applicable
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
**1.3.1.E Audio training data size:** Not applicable. Audio data is not part of the training data
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
**1.3.1.F Audio training data content:** Not applicable
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
**1.3.1.G Video training data size:** Not applicable. Video data is not part of the training data
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
**1.3.1.H Video training data content:** Not applicable
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
**1.3.1.I Other training data size:** Not applicable
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
**1.3.1.J Other training data content:** Not applicable
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
**1.3.2 Latest date of data acquisition/collection for model training:** 30-Jun-2024
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
**1.3.3 Is data collection ongoing to update the model with new data collection after deployment?** No
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
**1.3.4 Date the training dataset was first used to train the model:** 10/01/2024
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
**1.3.5 Rationale or purpose of data selection:** Datasets were selected to maximize high-quality reasoning and problem-solving capabilities. The mixture emphasizes synthetic, curriculum-structured data and rigorously filtered organic sources such as academic papers, licensed books, code, and Q&A to improve STEM reasoning, coding, and general knowledge while reducing noise and contamination. Targeted acquisitions and multilingual content complement synthetic data to balance reasoning strength with factual coverage
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
## 2. List of data sources
|
| 108 |
-
|
| 109 |
-
### 2.1 Publicly available datasets
|
| 110 |
-
|
| 111 |
-
**2.1.1 Have you used publicly available datasets to train the model?** Yes
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
## 2.2 Private non-publicly available datasets obtained from third parties
|
| 116 |
-
|
| 117 |
-
### 2.2.1 Datasets commercially licensed by rights holders or their representatives
|
| 118 |
-
|
| 119 |
-
**2.2.1.A Have you concluded transactional commercial licensing agreement(s) with rights holder(s) or with their representatives?** Yes
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
### 2.2.2 Private datasets obtained from other third-parties
|
| 124 |
-
|
| 125 |
-
**2.2.2.A Have you obtained private datasets from third parties that are not licensed as described in Section 2.2.1, such as data obtained from providers of private databases, or data intermediaries?** This information cannot be provided due to unavailability of the underlying data (e.g., loss, corruption, or other access limitations)
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
## 2.3 Personal Information
|
| 130 |
-
|
| 131 |
-
**2.3.1 Was personal data used to train the model?** Microsoft follows all relevant laws and regulations pertaining to personal information
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
## 2.4 Synthetic data
|
| 136 |
-
|
| 137 |
-
**2.4.1 Was any synthetic AI-generated data used to train the model?** Yes
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
## 3. Data processing aspects
|
| 142 |
-
|
| 143 |
-
### 3.1 Respect of reservation of rights from text and data mining exception or limitation
|
| 144 |
-
|
| 145 |
-
**3.1.1 Does this dataset include any data protected by copyright, trademark, or patent?** Microsoft follows all required regulations and laws for processing data protected by copyright, trademark, or patent
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
## 3.2 Other information
|
| 150 |
-
|
| 151 |
-
**3.2.1 Does the dataset include information about consumer groups without revealing individual consumer identities?** Microsoft follows all required regulations and laws for protecting consumer identities
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
**3.2.2 Was the dataset cleaned or modified before model training?** Yes
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
generation_config.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
"bos_token_id": 100257,
|
| 4 |
-
"eos_token_id":
|
| 5 |
-
|
|
|
|
|
|
|
| 6 |
"transformers_version": "4.47.0"
|
| 7 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
"bos_token_id": 100257,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
100257,
|
| 6 |
+
100265
|
| 7 |
+
],
|
| 8 |
"transformers_version": "4.47.0"
|
| 9 |
}
|
special_tokens_map.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
"bos_token": "<|endoftext|>",
|
| 3 |
-
"eos_token": "<|
|
| 4 |
-
"pad_token": "<|
|
| 5 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"bos_token": "<|endoftext|>",
|
| 3 |
+
"eos_token": "<|endoftext|>",
|
| 4 |
+
"pad_token": "<|endoftext|>"
|
| 5 |
}
|
tokenizer_config.json
CHANGED
|
@@ -771,10 +771,10 @@
|
|
| 771 |
}
|
| 772 |
},
|
| 773 |
"bos_token": "<|endoftext|>",
|
| 774 |
-
"chat_template": "{% for message in messages %}{% if (message['role'] == 'system') %}{{'<|im_start|>system<|im_sep|>' + message['content'] + '<|im_end|>'}}{% elif (message['role'] == 'user') %}{{'<|im_start|>user<|im_sep|>' + message['content'] + '<|im_end|>'}}{% elif (message['role'] == 'assistant') %}{{
|
| 775 |
"clean_up_tokenization_spaces": false,
|
| 776 |
-
"eos_token": "<|
|
| 777 |
"model_max_length": 16384,
|
| 778 |
-
"pad_token": "<|
|
| 779 |
"tokenizer_class": "GPT2Tokenizer"
|
| 780 |
}
|
|
|
|
| 771 |
}
|
| 772 |
},
|
| 773 |
"bos_token": "<|endoftext|>",
|
| 774 |
+
"chat_template": "{% for message in messages %}{% if (message['role'] == 'system') %}{{'<|im_start|>system<|im_sep|>' + message['content'] + '<|im_end|>'}}{% elif (message['role'] == 'user') %}{{'<|im_start|>user<|im_sep|>' + message['content'] + '<|im_end|><|im_start|>assistant<|im_sep|>'}}{% elif (message['role'] == 'assistant') %}{{message['content'] + '<|im_end|>'}}{% endif %}{% endfor %}",
|
| 775 |
"clean_up_tokenization_spaces": false,
|
| 776 |
+
"eos_token": "<|endoftext|>",
|
| 777 |
"model_max_length": 16384,
|
| 778 |
+
"pad_token": "<|endoftext|>",
|
| 779 |
"tokenizer_class": "GPT2Tokenizer"
|
| 780 |
}
|