lbourdois commited on
Commit
07369df
·
verified ·
1 Parent(s): 0bb06f5

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