ThomasBaruzier lbourdois commited on
Commit
2700fd6
·
verified ·
1 Parent(s): 2389dba

Improve language tag (#1)

Browse files

- Improve language tag (bb09e1d36caece9c8aa1ca87321e8ad0417917b1)


Co-authored-by: Loïck BOURDOIS <[email protected]>

Files changed (1) hide show
  1. README.md +170 -158
README.md CHANGED
@@ -1,159 +1,171 @@
1
- ---
2
- license: other
3
- license_name: qwen-research
4
- license_link: https://huggingface.co/Qwen/Qwen2.5-3B-Instruct/blob/main/LICENSE
5
- language:
6
- - en
7
- pipeline_tag: text-generation
8
- base_model: Qwen/Qwen2.5-3B
9
- tags:
10
- - chat
11
- ---
12
-
13
- <hr>
14
-
15
- # Llama.cpp imatrix quantizations of Qwen/Qwen2.5-3B-Instruct
16
-
17
- <img src="https://cdn-uploads.huggingface.co/production/uploads/646410e04bf9122922289dc7/gDUbZOu1ND0j-th4Q6tep.jpeg" alt="qwen" width="60%"/>
18
-
19
- Using llama.cpp commit [eca0fab](https://github.com/ggerganov/llama.cpp/commit/eca0fab) for quantization.
20
-
21
- Original model: [Qwen/Qwen2.5-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-3B-Instruct)
22
-
23
- All quants were made using the imatrix option and Bartowski's [calibration file](https://gist.github.com/bartowski1182/eb213dccb3571f863da82e99418f81e8).
24
-
25
- <hr>
26
-
27
- # Perplexity table (the lower the better)
28
-
29
- | Quant | Size (MB) | PPL | Size (%) | Accuracy (%) | PPL error rate |
30
- | ------- | --------- | -------- | -------- | ------------ | -------------- |
31
- | IQ1_S | 755 | 112.0612 | 12.81 | 8.02 | 0.97138 |
32
- | IQ1_M | 811 | 42.7456 | 13.76 | 21.03 | 0.34718 |
33
- | IQ2_XXS | 905 | 25.2117 | 15.36 | 35.65 | 0.20222 |
34
- | IQ2_XS | 984 | 15.9149 | 16.7 | 56.48 | 0.11965 |
35
- | IQ2_S | 1013 | 14.5975 | 17.19 | 61.58 | 0.1082 |
36
- | IQ2_M | 1088 | 12.8779 | 18.46 | 69.8 | 0.09436 |
37
- | Q2_K_S | 1143 | 13.0878 | 19.4 | 68.68 | 0.09636 |
38
- | Q2_K | 1216 | 11.8001 | 20.63 | 76.18 | 0.08674 |
39
- | IQ3_XXS | 1224 | 10.6049 | 20.77 | 84.76 | 0.07572 |
40
- | IQ3_XS | 1328 | 10.0306 | 22.54 | 89.61 | 0.06975 |
41
- | Q3_K_S | 1387 | 15.5457 | 23.54 | 57.82 | 0.11941 |
42
- | IQ3_S | 1390 | 9.9591 | 23.59 | 90.26 | 0.06984 |
43
- | IQ3_M | 1420 | 9.9957 | 24.1 | 89.93 | 0.06962 |
44
- | Q3_K_M | 1517 | 14.0989 | 25.74 | 63.76 | 0.10568 |
45
- | Q3_K_L | 1629 | 13.8579 | 27.64 | 64.86 | 0.10372 |
46
- | IQ4_XS | 1659 | 9.2935 | 28.15 | 96.72 | 0.06517 |
47
- | IQ4_NL | 1741 | 9.2824 | 29.54 | 96.84 | 0.06503 |
48
- | Q4_0 | 1744 | 9.485 | 29.59 | 94.77 | 0.06626 |
49
- | Q4_K_S | 1750 | 9.2573 | 29.7 | 97.1 | 0.06485 |
50
- | Q4_K_M | 1841 | 9.2305 | 31.24 | 97.38 | 0.06475 |
51
- | Q4_1 | 1904 | 9.2746 | 32.31 | 96.92 | 0.06512 |
52
- | Q5_K_S | 2070 | 9.1338 | 35.13 | 98.41 | 0.06402 |
53
- | Q5_0 | 2075 | 9.1513 | 35.21 | 98.22 | 0.06413 |
54
- | Q5_K_M | 2122 | 9.1339 | 36.01 | 98.41 | 0.06407 |
55
- | Q5_1 | 2235 | 9.1231 | 37.93 | 98.53 | 0.06386 |
56
- | Q6_K | 2421 | 9.069 | 41.08 | 99.12 | 0.06342 |
57
- | Q8_0 | 3134 | 9.0114 | 53.18 | 99.75 | 0.06285 |
58
- | F16 | 5893 | 8.9888 | 100 | 100 | 0.06268 |
59
-
60
- <hr>
61
-
62
- # Qwen2.5-3B-Instruct
63
-
64
- ## Introduction
65
-
66
- Qwen2.5 is the latest series of Qwen large language models. For Qwen2.5, we release a number of base language models and instruction-tuned language models ranging from 0.5 to 72 billion parameters. Qwen2.5 brings the following improvements upon Qwen2:
67
-
68
- - Significantly **more knowledge** and has greatly improved capabilities in **coding** and **mathematics**, thanks to our specialized expert models in these domains.
69
- - Significant improvements in **instruction following**, **generating long texts** (over 8K tokens), **understanding structured data** (e.g, tables), and **generating structured outputs** especially JSON. **More resilient to the diversity of system prompts**, enhancing role-play implementation and condition-setting for chatbots.
70
- - **Long-context Support** up to 128K tokens and can generate up to 8K tokens.
71
- - **Multilingual support** for over 29 languages, including Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic, and more.
72
-
73
- **This repo contains the instruction-tuned 3B Qwen2.5 model**, which has the following features:
74
- - Type: Causal Language Models
75
- - Training Stage: Pretraining & Post-training
76
- - Architecture: transformers with RoPE, SwiGLU, RMSNorm, Attention QKV bias and tied word embeddings
77
- - Number of Parameters: 3.09B
78
- - Number of Paramaters (Non-Embedding): 2.77B
79
- - Number of Layers: 36
80
- - Number of Attention Heads (GQA): 16 for Q and 2 for KV
81
- - Context Length: Full 32,768 tokens and generation 8192 tokens
82
-
83
- For more details, please refer to our [blog](https://qwenlm.github.io/blog/qwen2.5/), [GitHub](https://github.com/QwenLM/Qwen2.5), and [Documentation](https://qwen.readthedocs.io/en/latest/).
84
-
85
- ## Requirements
86
-
87
- The code of Qwen2.5 has been in the latest Hugging face `transformers` and we advise you to use the latest version of `transformers`.
88
-
89
- With `transformers<4.37.0`, you will encounter the following error:
90
- ```
91
- KeyError: 'qwen2'
92
- ```
93
-
94
- ## Quickstart
95
-
96
- Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
97
-
98
- ```python
99
- from transformers import AutoModelForCausalLM, AutoTokenizer
100
-
101
- model_name = "Qwen/Qwen2.5-3B-Instruct"
102
-
103
- model = AutoModelForCausalLM.from_pretrained(
104
- model_name,
105
- torch_dtype="auto",
106
- device_map="auto"
107
- )
108
- tokenizer = AutoTokenizer.from_pretrained(model_name)
109
-
110
- prompt = "Give me a short introduction to large language model."
111
- messages = [
112
- {"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."},
113
- {"role": "user", "content": prompt}
114
- ]
115
- text = tokenizer.apply_chat_template(
116
- messages,
117
- tokenize=False,
118
- add_generation_prompt=True
119
- )
120
- model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
121
-
122
- generated_ids = model.generate(
123
- **model_inputs,
124
- max_new_tokens=512
125
- )
126
- generated_ids = [
127
- output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
128
- ]
129
-
130
- response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
131
- ```
132
-
133
-
134
- ## Evaluation & Performance
135
-
136
- Detailed evaluation results are reported in this [📑 blog](https://qwenlm.github.io/blog/qwen2.5/).
137
-
138
- For requirements on GPU memory and the respective throughput, see results [here](https://qwen.readthedocs.io/en/latest/benchmark/speed_benchmark.html).
139
-
140
- ## Citation
141
-
142
- If you find our work helpful, feel free to give us a cite.
143
-
144
- ```
145
- @misc{qwen2.5,
146
- title = {Qwen2.5: A Party of Foundation Models},
147
- url = {https://qwenlm.github.io/blog/qwen2.5/},
148
- author = {Qwen Team},
149
- month = {September},
150
- year = {2024}
151
- }
152
-
153
- @article{qwen2,
154
- title={Qwen2 Technical Report},
155
- author={An Yang and Baosong Yang and Binyuan Hui and Bo Zheng and Bowen Yu and Chang Zhou and Chengpeng Li and Chengyuan Li and Dayiheng Liu and Fei Huang and Guanting Dong and Haoran Wei and Huan Lin and Jialong Tang and Jialin Wang and Jian Yang and Jianhong Tu and Jianwei Zhang and Jianxin Ma and Jin Xu and Jingren Zhou and Jinze Bai and Jinzheng He and Junyang Lin and Kai Dang and Keming Lu and Keqin Chen and Kexin Yang and Mei Li and Mingfeng Xue and Na Ni and Pei Zhang and Peng Wang and Ru Peng and Rui Men and Ruize Gao and Runji Lin and Shijie Wang and Shuai Bai and Sinan Tan and Tianhang Zhu and Tianhao Li and Tianyu Liu and Wenbin Ge and Xiaodong Deng and Xiaohuan Zhou and Xingzhang Ren and Xinyu Zhang and Xipin Wei and Xuancheng Ren and Yang Fan and Yang Yao and Yichang Zhang and Yu Wan and Yunfei Chu and Yuqiong Liu and Zeyu Cui and Zhenru Zhang and Zhihao Fan},
156
- journal={arXiv preprint arXiv:2407.10671},
157
- year={2024}
158
- }
 
 
 
 
 
 
 
 
 
 
 
 
159
  ```
 
1
+ ---
2
+ license: other
3
+ license_name: qwen-research
4
+ license_link: https://huggingface.co/Qwen/Qwen2.5-3B-Instruct/blob/main/LICENSE
5
+ language:
6
+ - zho
7
+ - eng
8
+ - fra
9
+ - spa
10
+ - por
11
+ - deu
12
+ - ita
13
+ - rus
14
+ - jpn
15
+ - kor
16
+ - vie
17
+ - tha
18
+ - ara
19
+ pipeline_tag: text-generation
20
+ base_model: Qwen/Qwen2.5-3B
21
+ tags:
22
+ - chat
23
+ ---
24
+
25
+ <hr>
26
+
27
+ # Llama.cpp imatrix quantizations of Qwen/Qwen2.5-3B-Instruct
28
+
29
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/646410e04bf9122922289dc7/gDUbZOu1ND0j-th4Q6tep.jpeg" alt="qwen" width="60%"/>
30
+
31
+ Using llama.cpp commit [eca0fab](https://github.com/ggerganov/llama.cpp/commit/eca0fab) for quantization.
32
+
33
+ Original model: [Qwen/Qwen2.5-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-3B-Instruct)
34
+
35
+ All quants were made using the imatrix option and Bartowski's [calibration file](https://gist.github.com/bartowski1182/eb213dccb3571f863da82e99418f81e8).
36
+
37
+ <hr>
38
+
39
+ # Perplexity table (the lower the better)
40
+
41
+ | Quant | Size (MB) | PPL | Size (%) | Accuracy (%) | PPL error rate |
42
+ | ------- | --------- | -------- | -------- | ------------ | -------------- |
43
+ | IQ1_S | 755 | 112.0612 | 12.81 | 8.02 | 0.97138 |
44
+ | IQ1_M | 811 | 42.7456 | 13.76 | 21.03 | 0.34718 |
45
+ | IQ2_XXS | 905 | 25.2117 | 15.36 | 35.65 | 0.20222 |
46
+ | IQ2_XS | 984 | 15.9149 | 16.7 | 56.48 | 0.11965 |
47
+ | IQ2_S | 1013 | 14.5975 | 17.19 | 61.58 | 0.1082 |
48
+ | IQ2_M | 1088 | 12.8779 | 18.46 | 69.8 | 0.09436 |
49
+ | Q2_K_S | 1143 | 13.0878 | 19.4 | 68.68 | 0.09636 |
50
+ | Q2_K | 1216 | 11.8001 | 20.63 | 76.18 | 0.08674 |
51
+ | IQ3_XXS | 1224 | 10.6049 | 20.77 | 84.76 | 0.07572 |
52
+ | IQ3_XS | 1328 | 10.0306 | 22.54 | 89.61 | 0.06975 |
53
+ | Q3_K_S | 1387 | 15.5457 | 23.54 | 57.82 | 0.11941 |
54
+ | IQ3_S | 1390 | 9.9591 | 23.59 | 90.26 | 0.06984 |
55
+ | IQ3_M | 1420 | 9.9957 | 24.1 | 89.93 | 0.06962 |
56
+ | Q3_K_M | 1517 | 14.0989 | 25.74 | 63.76 | 0.10568 |
57
+ | Q3_K_L | 1629 | 13.8579 | 27.64 | 64.86 | 0.10372 |
58
+ | IQ4_XS | 1659 | 9.2935 | 28.15 | 96.72 | 0.06517 |
59
+ | IQ4_NL | 1741 | 9.2824 | 29.54 | 96.84 | 0.06503 |
60
+ | Q4_0 | 1744 | 9.485 | 29.59 | 94.77 | 0.06626 |
61
+ | Q4_K_S | 1750 | 9.2573 | 29.7 | 97.1 | 0.06485 |
62
+ | Q4_K_M | 1841 | 9.2305 | 31.24 | 97.38 | 0.06475 |
63
+ | Q4_1 | 1904 | 9.2746 | 32.31 | 96.92 | 0.06512 |
64
+ | Q5_K_S | 2070 | 9.1338 | 35.13 | 98.41 | 0.06402 |
65
+ | Q5_0 | 2075 | 9.1513 | 35.21 | 98.22 | 0.06413 |
66
+ | Q5_K_M | 2122 | 9.1339 | 36.01 | 98.41 | 0.06407 |
67
+ | Q5_1 | 2235 | 9.1231 | 37.93 | 98.53 | 0.06386 |
68
+ | Q6_K | 2421 | 9.069 | 41.08 | 99.12 | 0.06342 |
69
+ | Q8_0 | 3134 | 9.0114 | 53.18 | 99.75 | 0.06285 |
70
+ | F16 | 5893 | 8.9888 | 100 | 100 | 0.06268 |
71
+
72
+ <hr>
73
+
74
+ # Qwen2.5-3B-Instruct
75
+
76
+ ## Introduction
77
+
78
+ Qwen2.5 is the latest series of Qwen large language models. For Qwen2.5, we release a number of base language models and instruction-tuned language models ranging from 0.5 to 72 billion parameters. Qwen2.5 brings the following improvements upon Qwen2:
79
+
80
+ - Significantly **more knowledge** and has greatly improved capabilities in **coding** and **mathematics**, thanks to our specialized expert models in these domains.
81
+ - Significant improvements in **instruction following**, **generating long texts** (over 8K tokens), **understanding structured data** (e.g, tables), and **generating structured outputs** especially JSON. **More resilient to the diversity of system prompts**, enhancing role-play implementation and condition-setting for chatbots.
82
+ - **Long-context Support** up to 128K tokens and can generate up to 8K tokens.
83
+ - **Multilingual support** for over 29 languages, including Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic, and more.
84
+
85
+ **This repo contains the instruction-tuned 3B Qwen2.5 model**, which has the following features:
86
+ - Type: Causal Language Models
87
+ - Training Stage: Pretraining & Post-training
88
+ - Architecture: transformers with RoPE, SwiGLU, RMSNorm, Attention QKV bias and tied word embeddings
89
+ - Number of Parameters: 3.09B
90
+ - Number of Paramaters (Non-Embedding): 2.77B
91
+ - Number of Layers: 36
92
+ - Number of Attention Heads (GQA): 16 for Q and 2 for KV
93
+ - Context Length: Full 32,768 tokens and generation 8192 tokens
94
+
95
+ For more details, please refer to our [blog](https://qwenlm.github.io/blog/qwen2.5/), [GitHub](https://github.com/QwenLM/Qwen2.5), and [Documentation](https://qwen.readthedocs.io/en/latest/).
96
+
97
+ ## Requirements
98
+
99
+ The code of Qwen2.5 has been in the latest Hugging face `transformers` and we advise you to use the latest version of `transformers`.
100
+
101
+ With `transformers<4.37.0`, you will encounter the following error:
102
+ ```
103
+ KeyError: 'qwen2'
104
+ ```
105
+
106
+ ## Quickstart
107
+
108
+ Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
109
+
110
+ ```python
111
+ from transformers import AutoModelForCausalLM, AutoTokenizer
112
+
113
+ model_name = "Qwen/Qwen2.5-3B-Instruct"
114
+
115
+ model = AutoModelForCausalLM.from_pretrained(
116
+ model_name,
117
+ torch_dtype="auto",
118
+ device_map="auto"
119
+ )
120
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
121
+
122
+ prompt = "Give me a short introduction to large language model."
123
+ messages = [
124
+ {"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."},
125
+ {"role": "user", "content": prompt}
126
+ ]
127
+ text = tokenizer.apply_chat_template(
128
+ messages,
129
+ tokenize=False,
130
+ add_generation_prompt=True
131
+ )
132
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
133
+
134
+ generated_ids = model.generate(
135
+ **model_inputs,
136
+ max_new_tokens=512
137
+ )
138
+ generated_ids = [
139
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
140
+ ]
141
+
142
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
143
+ ```
144
+
145
+
146
+ ## Evaluation & Performance
147
+
148
+ Detailed evaluation results are reported in this [📑 blog](https://qwenlm.github.io/blog/qwen2.5/).
149
+
150
+ For requirements on GPU memory and the respective throughput, see results [here](https://qwen.readthedocs.io/en/latest/benchmark/speed_benchmark.html).
151
+
152
+ ## Citation
153
+
154
+ If you find our work helpful, feel free to give us a cite.
155
+
156
+ ```
157
+ @misc{qwen2.5,
158
+ title = {Qwen2.5: A Party of Foundation Models},
159
+ url = {https://qwenlm.github.io/blog/qwen2.5/},
160
+ author = {Qwen Team},
161
+ month = {September},
162
+ year = {2024}
163
+ }
164
+
165
+ @article{qwen2,
166
+ title={Qwen2 Technical Report},
167
+ author={An Yang and Baosong Yang and Binyuan Hui and Bo Zheng and Bowen Yu and Chang Zhou and Chengpeng Li and Chengyuan Li and Dayiheng Liu and Fei Huang and Guanting Dong and Haoran Wei and Huan Lin and Jialong Tang and Jialin Wang and Jian Yang and Jianhong Tu and Jianwei Zhang and Jianxin Ma and Jin Xu and Jingren Zhou and Jinze Bai and Jinzheng He and Junyang Lin and Kai Dang and Keming Lu and Keqin Chen and Kexin Yang and Mei Li and Mingfeng Xue and Na Ni and Pei Zhang and Peng Wang and Ru Peng and Rui Men and Ruize Gao and Runji Lin and Shijie Wang and Shuai Bai and Sinan Tan and Tianhang Zhu and Tianhao Li and Tianyu Liu and Wenbin Ge and Xiaodong Deng and Xiaohuan Zhou and Xingzhang Ren and Xinyu Zhang and Xipin Wei and Xuancheng Ren and Yang Fan and Yang Yao and Yichang Zhang and Yu Wan and Yunfei Chu and Yuqiong Liu and Zeyu Cui and Zhenru Zhang and Zhihao Fan},
168
+ journal={arXiv preprint arXiv:2407.10671},
169
+ year={2024}
170
+ }
171
  ```