Files changed (1) hide show
  1. README.md +157 -145
README.md CHANGED
@@ -1,146 +1,158 @@
1
- ---
2
- license: other
3
- license_name: qwen
4
- license_link: https://huggingface.co/Qwen/Qwen2.5-72B-Instruct/blob/main/LICENSE
5
- language:
6
- - en
7
- pipeline_tag: text-generation
8
- base_model: Qwen/Qwen2.5-72B
9
- tags:
10
- - chat
11
- ---
12
- # BigStorm - ExLLamaV2 (Exl2) Quantization
13
- - 7.0 bpw target
14
- - 8 head bits
15
-
16
- Enjoy! Raise an issue if you'd like other BPW levels.
17
- **Base Model Card Follows:**
18
- ---
19
- # BigStorm - ExLLamaV2 (Exl2) Quantization
20
- - 7.0 bpw target
21
- - 8 head bits
22
-
23
- Enjoy! Raise an issue if you'd like other BPW levels.
24
- **Base Model Card Follows:**
25
- ---
26
-
27
- # Qwen2.5-72B-Instruct
28
-
29
- ## Introduction
30
-
31
- 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:
32
-
33
- - Significantly **more knowledge** and has greatly improved capabilities in **coding** and **mathematics**, thanks to our specialized expert models in these domains.
34
- - 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.
35
- - **Long-context Support** up to 128K tokens and can generate up to 8K tokens.
36
- - **Multilingual support** for over 29 languages, including Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic, and more.
37
-
38
- **This repo contains the instruction-tuned 72B Qwen2.5 model**, which has the following features:
39
- - Type: Causal Language Models
40
- - Training Stage: Pretraining & Post-training
41
- - Architecture: transformers with RoPE, SwiGLU, RMSNorm, and Attention QKV bias
42
- - Number of Parameters: 72.7B
43
- - Number of Paramaters (Non-Embedding): 70.0B
44
- - Number of Layers: 80
45
- - Number of Attention Heads (GQA): 64 for Q and 8 for KV
46
- - Context Length: Full 131,072 tokens and generation 8192 tokens
47
- - Please refer to [this section](#processing-long-texts) for detailed instructions on how to deploy Qwen2.5 for handling long texts.
48
-
49
- 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/).
50
-
51
- ## Requirements
52
-
53
- The code of Qwen2.5 has been in the latest Hugging face `transformers` and we advise you to use the latest version of `transformers`.
54
-
55
- With `transformers<4.37.0`, you will encounter the following error:
56
- ```
57
- KeyError: 'qwen2'
58
- ```
59
-
60
- ## Quickstart
61
-
62
- Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
63
-
64
- ```python
65
- from transformers import AutoModelForCausalLM, AutoTokenizer
66
-
67
- model_name = "Qwen/Qwen2.5-72B-Instruct"
68
-
69
- model = AutoModelForCausalLM.from_pretrained(
70
- model_name,
71
- torch_dtype="auto",
72
- device_map="auto"
73
- )
74
- tokenizer = AutoTokenizer.from_pretrained(model_name)
75
-
76
- prompt = "Give me a short introduction to large language model."
77
- messages = [
78
- {"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."},
79
- {"role": "user", "content": prompt}
80
- ]
81
- text = tokenizer.apply_chat_template(
82
- messages,
83
- tokenize=False,
84
- add_generation_prompt=True
85
- )
86
- model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
87
-
88
- generated_ids = model.generate(
89
- **model_inputs,
90
- max_new_tokens=512
91
- )
92
- generated_ids = [
93
- output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
94
- ]
95
-
96
- response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
97
- ```
98
-
99
- ### Processing Long Texts
100
-
101
- The current `config.json` is set for context length up to 32,768 tokens.
102
- 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.
103
-
104
- For supported frameworks, you could add the following to `config.json` to enable YaRN:
105
- ```json
106
- {
107
- ...,
108
- "rope_scaling": {
109
- "factor": 4.0,
110
- "original_max_position_embeddings": 32768,
111
- "type": "yarn"
112
- }
113
- }
114
- ```
115
-
116
- For deployment, we recommend using vLLM.
117
- Please refer to our [Documentation](https://qwen.readthedocs.io/en/latest/deployment/vllm.html) for usage if you are not familar with vLLM.
118
- Presently, vLLM only supports static YARN, which means the scaling factor remains constant regardless of input length, **potentially impacting performance on shorter texts**.
119
- We advise adding the `rope_scaling` configuration only when processing long contexts is required.
120
-
121
- ## Evaluation & Performance
122
-
123
- Detailed evaluation results are reported in this [📑 blog](https://qwenlm.github.io/blog/qwen2.5/).
124
-
125
- For requirements on GPU memory and the respective throughput, see results [here](https://qwen.readthedocs.io/en/latest/benchmark/speed_benchmark.html).
126
-
127
- ## Citation
128
-
129
- If you find our work helpful, feel free to give us a cite.
130
-
131
- ```
132
- @misc{qwen2.5,
133
- title = {Qwen2.5: A Party of Foundation Models},
134
- url = {https://qwenlm.github.io/blog/qwen2.5/},
135
- author = {Qwen Team},
136
- month = {September},
137
- year = {2024}
138
- }
139
-
140
- @article{qwen2,
141
- title={Qwen2 Technical Report},
142
- 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},
143
- journal={arXiv preprint arXiv:2407.10671},
144
- year={2024}
145
- }
 
 
 
 
 
 
 
 
 
 
 
 
146
  ```
 
1
+ ---
2
+ license: other
3
+ license_name: qwen
4
+ license_link: https://huggingface.co/Qwen/Qwen2.5-72B-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-72B
21
+ tags:
22
+ - chat
23
+ ---
24
+ # BigStorm - ExLLamaV2 (Exl2) Quantization
25
+ - 7.0 bpw target
26
+ - 8 head bits
27
+
28
+ Enjoy! Raise an issue if you'd like other BPW levels.
29
+ **Base Model Card Follows:**
30
+ ---
31
+ # BigStorm - ExLLamaV2 (Exl2) Quantization
32
+ - 7.0 bpw target
33
+ - 8 head bits
34
+
35
+ Enjoy! Raise an issue if you'd like other BPW levels.
36
+ **Base Model Card Follows:**
37
+ ---
38
+
39
+ # Qwen2.5-72B-Instruct
40
+
41
+ ## Introduction
42
+
43
+ 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:
44
+
45
+ - Significantly **more knowledge** and has greatly improved capabilities in **coding** and **mathematics**, thanks to our specialized expert models in these domains.
46
+ - 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.
47
+ - **Long-context Support** up to 128K tokens and can generate up to 8K tokens.
48
+ - **Multilingual support** for over 29 languages, including Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic, and more.
49
+
50
+ **This repo contains the instruction-tuned 72B Qwen2.5 model**, which has the following features:
51
+ - Type: Causal Language Models
52
+ - Training Stage: Pretraining & Post-training
53
+ - Architecture: transformers with RoPE, SwiGLU, RMSNorm, and Attention QKV bias
54
+ - Number of Parameters: 72.7B
55
+ - Number of Paramaters (Non-Embedding): 70.0B
56
+ - Number of Layers: 80
57
+ - Number of Attention Heads (GQA): 64 for Q and 8 for KV
58
+ - Context Length: Full 131,072 tokens and generation 8192 tokens
59
+ - Please refer to [this section](#processing-long-texts) for detailed instructions on how to deploy Qwen2.5 for handling long texts.
60
+
61
+ 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/).
62
+
63
+ ## Requirements
64
+
65
+ The code of Qwen2.5 has been in the latest Hugging face `transformers` and we advise you to use the latest version of `transformers`.
66
+
67
+ With `transformers<4.37.0`, you will encounter the following error:
68
+ ```
69
+ KeyError: 'qwen2'
70
+ ```
71
+
72
+ ## Quickstart
73
+
74
+ Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
75
+
76
+ ```python
77
+ from transformers import AutoModelForCausalLM, AutoTokenizer
78
+
79
+ model_name = "Qwen/Qwen2.5-72B-Instruct"
80
+
81
+ model = AutoModelForCausalLM.from_pretrained(
82
+ model_name,
83
+ torch_dtype="auto",
84
+ device_map="auto"
85
+ )
86
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
87
+
88
+ prompt = "Give me a short introduction to large language model."
89
+ messages = [
90
+ {"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."},
91
+ {"role": "user", "content": prompt}
92
+ ]
93
+ text = tokenizer.apply_chat_template(
94
+ messages,
95
+ tokenize=False,
96
+ add_generation_prompt=True
97
+ )
98
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
99
+
100
+ generated_ids = model.generate(
101
+ **model_inputs,
102
+ max_new_tokens=512
103
+ )
104
+ generated_ids = [
105
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
106
+ ]
107
+
108
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
109
+ ```
110
+
111
+ ### Processing Long Texts
112
+
113
+ The current `config.json` is set for context length up to 32,768 tokens.
114
+ 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.
115
+
116
+ For supported frameworks, you could add the following to `config.json` to enable YaRN:
117
+ ```json
118
+ {
119
+ ...,
120
+ "rope_scaling": {
121
+ "factor": 4.0,
122
+ "original_max_position_embeddings": 32768,
123
+ "type": "yarn"
124
+ }
125
+ }
126
+ ```
127
+
128
+ For deployment, we recommend using vLLM.
129
+ Please refer to our [Documentation](https://qwen.readthedocs.io/en/latest/deployment/vllm.html) for usage if you are not familar with vLLM.
130
+ Presently, vLLM only supports static YARN, which means the scaling factor remains constant regardless of input length, **potentially impacting performance on shorter texts**.
131
+ We advise adding the `rope_scaling` configuration only when processing long contexts is required.
132
+
133
+ ## Evaluation & Performance
134
+
135
+ Detailed evaluation results are reported in this [📑 blog](https://qwenlm.github.io/blog/qwen2.5/).
136
+
137
+ For requirements on GPU memory and the respective throughput, see results [here](https://qwen.readthedocs.io/en/latest/benchmark/speed_benchmark.html).
138
+
139
+ ## Citation
140
+
141
+ If you find our work helpful, feel free to give us a cite.
142
+
143
+ ```
144
+ @misc{qwen2.5,
145
+ title = {Qwen2.5: A Party of Foundation Models},
146
+ url = {https://qwenlm.github.io/blog/qwen2.5/},
147
+ author = {Qwen Team},
148
+ month = {September},
149
+ year = {2024}
150
+ }
151
+
152
+ @article{qwen2,
153
+ title={Qwen2 Technical Report},
154
+ 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},
155
+ journal={arXiv preprint arXiv:2407.10671},
156
+ year={2024}
157
+ }
158
  ```