Text Generation
GGUF
chat
conversational
lbourdois commited on
Commit
2a3a93a
·
verified ·
1 Parent(s): fc79465

Improve language tag

Browse files

Hi! As the model is multilingual, this is a PR to add other languages than English to the language tag to improve the referencing. Note that 29 languages are announced in the README, but only 13 are explicitly listed. I was therefore only able to add these 13 languages.

Files changed (1) hide show
  1. README.md +191 -179
README.md CHANGED
@@ -1,180 +1,192 @@
1
- ---
2
- license: apache-2.0
3
- license_link: https://huggingface.co/Qwen/Qwen2.5-14B-Instruct/blob/main/LICENSE
4
- language:
5
- - en
6
- pipeline_tag: text-generation
7
- base_model: Qwen/Qwen2.5-14B
8
- tags:
9
- - chat
10
- ---
11
-
12
- <hr>
13
-
14
- # Llama.cpp imatrix quantizations of Qwen/Qwen2.5-14B-Instruct
15
-
16
- <img src="https://cdn-uploads.huggingface.co/production/uploads/646410e04bf9122922289dc7/gDUbZOu1ND0j-th4Q6tep.jpeg" alt="qwen" width="60%"/>
17
-
18
- Using llama.cpp commit [eca0fab](https://github.com/ggerganov/llama.cpp/commit/eca0fab) for quantization.
19
-
20
- Original model: [Qwen/Qwen2.5-14B-Instruct](https://huggingface.co/Qwen/Qwen2.5-14B-Instruct)
21
-
22
- All quants were made using the imatrix option and Bartowski's [calibration file](https://gist.github.com/bartowski1182/eb213dccb3571f863da82e99418f81e8).
23
-
24
- <hr>
25
-
26
- # Perplexity table (the lower the better)
27
-
28
- | Quant | Size (MB) | PPL | Size (%) | Accuracy (%) | PPL error rate |
29
- | ------- | --------- | ------- | -------- | ------------ | -------------- |
30
- | IQ1_S | 3441 | 22.0082 | 12.21 | 27.14 | 0.16818 |
31
- | IQ1_M | 3693 | 15.079 | 13.11 | 39.62 | 0.1106 |
32
- | IQ2_XXS | 4114 | 9.6047 | 14.6 | 62.2 | 0.06625 |
33
- | IQ2_XS | 4487 | 8.3649 | 15.92 | 71.41 | 0.05574 |
34
- | IQ2_S | 4772 | 8.1942 | 16.93 | 72.9 | 0.0548 |
35
- | IQ2_M | 5109 | 7.7261 | 18.13 | 77.32 | 0.05177 |
36
- | Q2_K_S | 5148 | 8.0641 | 18.27 | 74.08 | 0.0549 |
37
- | Q2_K | 5504 | 7.6005 | 19.53 | 78.6 | 0.05146 |
38
- | IQ3_XXS | 5672 | 6.9285 | 20.13 | 86.22 | 0.04547 |
39
- | IQ3_XS | 6088 | 6.721 | 21.6 | 88.88 | 0.04329 |
40
- | Q3_K_S | 6352 | 6.8697 | 22.54 | 86.96 | 0.04576 |
41
- | IQ3_S | 6383 | 6.6246 | 22.65 | 90.17 | 0.04285 |
42
- | IQ3_M | 6597 | 6.6359 | 23.41 | 90.02 | 0.04256 |
43
- | Q3_K_M | 7000 | 6.5281 | 24.84 | 91.51 | 0.043 |
44
- | Q3_K_L | 7558 | 6.4323 | 26.82 | 92.87 | 0.04211 |
45
- | IQ4_XS | 7744 | 6.2005 | 27.48 | 96.34 | 0.04022 |
46
- | Q4_0 | 8149 | 6.2928 | 28.92 | 94.93 | 0.04095 |
47
- | IQ4_NL | 8154 | 6.208 | 28.94 | 96.23 | 0.04032 |
48
- | Q4_K_S | 8177 | 6.163 | 29.02 | 96.93 | 0.03976 |
49
- | Q4_K_M | 8572 | 6.1311 | 30.42 | 97.43 | 0.03957 |
50
- | Q4_1 | 8958 | 6.1674 | 31.79 | 96.86 | 0.03981 |
51
- | Q5_K_S | 9791 | 6.0411 | 34.75 | 98.88 | 0.03886 |
52
- | Q5_0 | 9817 | 6.0504 | 34.84 | 98.73 | 0.03895 |
53
- | Q5_K_M | 10023 | 6.0389 | 35.57 | 98.92 | 0.03888 |
54
- | Q5_1 | 10625 | 6.0366 | 37.71 | 98.96 | 0.03885 |
55
- | Q6_K | 11564 | 6.0004 | 41.04 | 99.56 | 0.0386 |
56
- | Q8_0 | 14975 | 5.9821 | 53.14 | 99.86 | 0.03842 |
57
- | F16 | 28179 | 5.9737 | 100 | 100 | 0.03835 |
58
-
59
- <hr>
60
-
61
- # Qwen2.5-14B-Instruct
62
-
63
- ## Introduction
64
-
65
- 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:
66
-
67
- - Significantly **more knowledge** and has greatly improved capabilities in **coding** and **mathematics**, thanks to our specialized expert models in these domains.
68
- - 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.
69
- - **Long-context Support** up to 128K tokens and can generate up to 8K tokens.
70
- - **Multilingual support** for over 29 languages, including Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic, and more.
71
-
72
- **This repo contains the instruction-tuned 14B Qwen2.5 model**, which has the following features:
73
- - Type: Causal Language Models
74
- - Training Stage: Pretraining & Post-training
75
- - Architecture: transformers with RoPE, SwiGLU, RMSNorm, and Attention QKV bias
76
- - Number of Parameters: 14.7B
77
- - Number of Paramaters (Non-Embedding): 13.1B
78
- - Number of Layers: 48
79
- - Number of Attention Heads (GQA): 40 for Q and 8 for KV
80
- - Context Length: Full 131,072 tokens and generation 8192 tokens
81
- - Please refer to [this section](#processing-long-texts) for detailed instructions on how to deploy Qwen2.5 for handling long texts.
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-14B-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
- ### Processing Long Texts
134
-
135
- The current `config.json` is set for context length up to 32,768 tokens.
136
- To handle extensive inputs exceeding 32,768 tokens, we utilize [YaRN](https://arxiv.org/abs/2309.00071), a technique for enhancing model length extrapolation, ensuring optimal performance on lengthy texts.
137
-
138
- For supported frameworks, you could add the following to `config.json` to enable YaRN:
139
- ```json
140
- {
141
- ...,
142
- "rope_scaling": {
143
- "factor": 4.0,
144
- "original_max_position_embeddings": 32768,
145
- "type": "yarn"
146
- }
147
- }
148
- ```
149
-
150
- For deployment, we recommend using vLLM.
151
- Please refer to our [Documentation](https://qwen.readthedocs.io/en/latest/deployment/vllm.html) for usage if you are not familar with vLLM.
152
- Presently, vLLM only supports static YARN, which means the scaling factor remains constant regardless of input length, **potentially impacting performance on shorter texts**.
153
- We advise adding the `rope_scaling` configuration only when processing long contexts is required.
154
-
155
- ## Evaluation & Performance
156
-
157
- Detailed evaluation results are reported in this [📑 blog](https://qwenlm.github.io/blog/qwen2.5/).
158
-
159
- For requirements on GPU memory and the respective throughput, see results [here](https://qwen.readthedocs.io/en/latest/benchmark/speed_benchmark.html).
160
-
161
- ## Citation
162
-
163
- If you find our work helpful, feel free to give us a cite.
164
-
165
- ```
166
- @misc{qwen2.5,
167
- title = {Qwen2.5: A Party of Foundation Models},
168
- url = {https://qwenlm.github.io/blog/qwen2.5/},
169
- author = {Qwen Team},
170
- month = {September},
171
- year = {2024}
172
- }
173
-
174
- @article{qwen2,
175
- title={Qwen2 Technical Report},
176
- 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},
177
- journal={arXiv preprint arXiv:2407.10671},
178
- year={2024}
179
- }
 
 
 
 
 
 
 
 
 
 
 
 
180
  ```
 
1
+ ---
2
+ license: apache-2.0
3
+ license_link: https://huggingface.co/Qwen/Qwen2.5-14B-Instruct/blob/main/LICENSE
4
+ language:
5
+ - zho
6
+ - eng
7
+ - fra
8
+ - spa
9
+ - por
10
+ - deu
11
+ - ita
12
+ - rus
13
+ - jpn
14
+ - kor
15
+ - vie
16
+ - tha
17
+ - ara
18
+ pipeline_tag: text-generation
19
+ base_model: Qwen/Qwen2.5-14B
20
+ tags:
21
+ - chat
22
+ ---
23
+
24
+ <hr>
25
+
26
+ # Llama.cpp imatrix quantizations of Qwen/Qwen2.5-14B-Instruct
27
+
28
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/646410e04bf9122922289dc7/gDUbZOu1ND0j-th4Q6tep.jpeg" alt="qwen" width="60%"/>
29
+
30
+ Using llama.cpp commit [eca0fab](https://github.com/ggerganov/llama.cpp/commit/eca0fab) for quantization.
31
+
32
+ Original model: [Qwen/Qwen2.5-14B-Instruct](https://huggingface.co/Qwen/Qwen2.5-14B-Instruct)
33
+
34
+ All quants were made using the imatrix option and Bartowski's [calibration file](https://gist.github.com/bartowski1182/eb213dccb3571f863da82e99418f81e8).
35
+
36
+ <hr>
37
+
38
+ # Perplexity table (the lower the better)
39
+
40
+ | Quant | Size (MB) | PPL | Size (%) | Accuracy (%) | PPL error rate |
41
+ | ------- | --------- | ------- | -------- | ------------ | -------------- |
42
+ | IQ1_S | 3441 | 22.0082 | 12.21 | 27.14 | 0.16818 |
43
+ | IQ1_M | 3693 | 15.079 | 13.11 | 39.62 | 0.1106 |
44
+ | IQ2_XXS | 4114 | 9.6047 | 14.6 | 62.2 | 0.06625 |
45
+ | IQ2_XS | 4487 | 8.3649 | 15.92 | 71.41 | 0.05574 |
46
+ | IQ2_S | 4772 | 8.1942 | 16.93 | 72.9 | 0.0548 |
47
+ | IQ2_M | 5109 | 7.7261 | 18.13 | 77.32 | 0.05177 |
48
+ | Q2_K_S | 5148 | 8.0641 | 18.27 | 74.08 | 0.0549 |
49
+ | Q2_K | 5504 | 7.6005 | 19.53 | 78.6 | 0.05146 |
50
+ | IQ3_XXS | 5672 | 6.9285 | 20.13 | 86.22 | 0.04547 |
51
+ | IQ3_XS | 6088 | 6.721 | 21.6 | 88.88 | 0.04329 |
52
+ | Q3_K_S | 6352 | 6.8697 | 22.54 | 86.96 | 0.04576 |
53
+ | IQ3_S | 6383 | 6.6246 | 22.65 | 90.17 | 0.04285 |
54
+ | IQ3_M | 6597 | 6.6359 | 23.41 | 90.02 | 0.04256 |
55
+ | Q3_K_M | 7000 | 6.5281 | 24.84 | 91.51 | 0.043 |
56
+ | Q3_K_L | 7558 | 6.4323 | 26.82 | 92.87 | 0.04211 |
57
+ | IQ4_XS | 7744 | 6.2005 | 27.48 | 96.34 | 0.04022 |
58
+ | Q4_0 | 8149 | 6.2928 | 28.92 | 94.93 | 0.04095 |
59
+ | IQ4_NL | 8154 | 6.208 | 28.94 | 96.23 | 0.04032 |
60
+ | Q4_K_S | 8177 | 6.163 | 29.02 | 96.93 | 0.03976 |
61
+ | Q4_K_M | 8572 | 6.1311 | 30.42 | 97.43 | 0.03957 |
62
+ | Q4_1 | 8958 | 6.1674 | 31.79 | 96.86 | 0.03981 |
63
+ | Q5_K_S | 9791 | 6.0411 | 34.75 | 98.88 | 0.03886 |
64
+ | Q5_0 | 9817 | 6.0504 | 34.84 | 98.73 | 0.03895 |
65
+ | Q5_K_M | 10023 | 6.0389 | 35.57 | 98.92 | 0.03888 |
66
+ | Q5_1 | 10625 | 6.0366 | 37.71 | 98.96 | 0.03885 |
67
+ | Q6_K | 11564 | 6.0004 | 41.04 | 99.56 | 0.0386 |
68
+ | Q8_0 | 14975 | 5.9821 | 53.14 | 99.86 | 0.03842 |
69
+ | F16 | 28179 | 5.9737 | 100 | 100 | 0.03835 |
70
+
71
+ <hr>
72
+
73
+ # Qwen2.5-14B-Instruct
74
+
75
+ ## Introduction
76
+
77
+ 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:
78
+
79
+ - Significantly **more knowledge** and has greatly improved capabilities in **coding** and **mathematics**, thanks to our specialized expert models in these domains.
80
+ - 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.
81
+ - **Long-context Support** up to 128K tokens and can generate up to 8K tokens.
82
+ - **Multilingual support** for over 29 languages, including Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic, and more.
83
+
84
+ **This repo contains the instruction-tuned 14B Qwen2.5 model**, which has the following features:
85
+ - Type: Causal Language Models
86
+ - Training Stage: Pretraining & Post-training
87
+ - Architecture: transformers with RoPE, SwiGLU, RMSNorm, and Attention QKV bias
88
+ - Number of Parameters: 14.7B
89
+ - Number of Paramaters (Non-Embedding): 13.1B
90
+ - Number of Layers: 48
91
+ - Number of Attention Heads (GQA): 40 for Q and 8 for KV
92
+ - Context Length: Full 131,072 tokens and generation 8192 tokens
93
+ - Please refer to [this section](#processing-long-texts) for detailed instructions on how to deploy Qwen2.5 for handling long texts.
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-14B-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
+ ### Processing Long Texts
146
+
147
+ The current `config.json` is set for context length up to 32,768 tokens.
148
+ To handle extensive inputs exceeding 32,768 tokens, we utilize [YaRN](https://arxiv.org/abs/2309.00071), a technique for enhancing model length extrapolation, ensuring optimal performance on lengthy texts.
149
+
150
+ For supported frameworks, you could add the following to `config.json` to enable YaRN:
151
+ ```json
152
+ {
153
+ ...,
154
+ "rope_scaling": {
155
+ "factor": 4.0,
156
+ "original_max_position_embeddings": 32768,
157
+ "type": "yarn"
158
+ }
159
+ }
160
+ ```
161
+
162
+ For deployment, we recommend using vLLM.
163
+ Please refer to our [Documentation](https://qwen.readthedocs.io/en/latest/deployment/vllm.html) for usage if you are not familar with vLLM.
164
+ Presently, vLLM only supports static YARN, which means the scaling factor remains constant regardless of input length, **potentially impacting performance on shorter texts**.
165
+ We advise adding the `rope_scaling` configuration only when processing long contexts is required.
166
+
167
+ ## Evaluation & Performance
168
+
169
+ Detailed evaluation results are reported in this [📑 blog](https://qwenlm.github.io/blog/qwen2.5/).
170
+
171
+ For requirements on GPU memory and the respective throughput, see results [here](https://qwen.readthedocs.io/en/latest/benchmark/speed_benchmark.html).
172
+
173
+ ## Citation
174
+
175
+ If you find our work helpful, feel free to give us a cite.
176
+
177
+ ```
178
+ @misc{qwen2.5,
179
+ title = {Qwen2.5: A Party of Foundation Models},
180
+ url = {https://qwenlm.github.io/blog/qwen2.5/},
181
+ author = {Qwen Team},
182
+ month = {September},
183
+ year = {2024}
184
+ }
185
+
186
+ @article{qwen2,
187
+ title={Qwen2 Technical Report},
188
+ 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},
189
+ journal={arXiv preprint arXiv:2407.10671},
190
+ year={2024}
191
+ }
192
  ```