Files changed (1) hide show
  1. README.md +138 -126
README.md CHANGED
@@ -1,127 +1,139 @@
1
- ---
2
- license: apache-2.0
3
- license_link: https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct/blob/main/LICENSE
4
- language:
5
- - en
6
- pipeline_tag: text-generation
7
- base_model: Qwen/Qwen2.5-1.5B-Instruct
8
- tags:
9
- - chat
10
- library_name: Exllamav2
11
- ---
12
- # Qwen2.5-1.5B-Instruct-exl2
13
- Model: [Qwen2.5-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct)
14
- Creator: [Qwen](https://huggingface.co/Qwen)
15
-
16
- ## Quants
17
- [4bpw h6 (main)](https://huggingface.co/cgus/Qwen2.5-1.5B-Instruct-exl2/tree/main)
18
- [4.5bpw h6](https://huggingface.co/cgus/Qwen2.5-1.5B-Instruct-exl2/tree/4.5bpw-h6)
19
- [5bpw h6](https://huggingface.co/cgus/Qwen2.5-1.5B-Instruct-exl2/tree/5bpw-h6)
20
- [5.5bpw h6](https://huggingface.co/cgus/Qwen2.5-1.5B-Instruct-exl2/tree/5.5bpw-h6)
21
- [6bpw h6](https://huggingface.co/cgus/Qwen2.5-1.5B-Instruct-exl2/tree/6bpw-h6)
22
- [6.5bpw h8](https://huggingface.co/cgus/Qwen2.5-1.5B-Instruct-exl2/tree/6.5bpw-h8)
23
- [8bpw h8](https://huggingface.co/cgus/Qwen2.5-1.5B-Instruct-exl2/tree/8bpw-h8)
24
-
25
- ## Quantization notes
26
- Made with Exllamav2 0.2.4 with the default dataset.
27
- These quants might be useful as a draft model for 32B/70B model with TabbyAPI.
28
- Exllamav2 supports Nvidia RTX GPUs on Windows and Nvidia RTX and ROCm AMD cards on Linux.
29
-
30
- # Qwen2.5-1.5B-Instruct
31
-
32
- ## Introduction
33
-
34
- 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:
35
-
36
- - Significantly **more knowledge** and has greatly improved capabilities in **coding** and **mathematics**, thanks to our specialized expert models in these domains.
37
- - 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.
38
- - **Long-context Support** up to 128K tokens and can generate up to 8K tokens.
39
- - **Multilingual support** for over 29 languages, including Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic, and more.
40
-
41
- **This repo contains the instruction-tuned 1.5B Qwen2.5 model**, which has the following features:
42
- - Type: Causal Language Models
43
- - Training Stage: Pretraining & Post-training
44
- - Architecture: transformers with RoPE, SwiGLU, RMSNorm, Attention QKV bias and tied word embeddings
45
- - Number of Parameters: 1.54B
46
- - Number of Paramaters (Non-Embedding): 1.31B
47
- - Number of Layers: 28
48
- - Number of Attention Heads (GQA): 12 for Q and 2 for KV
49
- - Context Length: Full 32,768 tokens and generation 8192 tokens
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-1.5B-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
-
102
- ## Evaluation & Performance
103
-
104
- Detailed evaluation results are reported in this [📑 blog](https://qwenlm.github.io/blog/qwen2.5/).
105
-
106
- For requirements on GPU memory and the respective throughput, see results [here](https://qwen.readthedocs.io/en/latest/benchmark/speed_benchmark.html).
107
-
108
- ## Citation
109
-
110
- If you find our work helpful, feel free to give us a cite.
111
-
112
- ```
113
- @misc{qwen2.5,
114
- title = {Qwen2.5: A Party of Foundation Models},
115
- url = {https://qwenlm.github.io/blog/qwen2.5/},
116
- author = {Qwen Team},
117
- month = {September},
118
- year = {2024}
119
- }
120
-
121
- @article{qwen2,
122
- title={Qwen2 Technical Report},
123
- 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},
124
- journal={arXiv preprint arXiv:2407.10671},
125
- year={2024}
126
- }
 
 
 
 
 
 
 
 
 
 
 
 
127
  ```
 
1
+ ---
2
+ license: apache-2.0
3
+ license_link: https://huggingface.co/Qwen/Qwen2.5-1.5B-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-1.5B-Instruct
20
+ tags:
21
+ - chat
22
+ library_name: Exllamav2
23
+ ---
24
+ # Qwen2.5-1.5B-Instruct-exl2
25
+ Model: [Qwen2.5-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct)
26
+ Creator: [Qwen](https://huggingface.co/Qwen)
27
+
28
+ ## Quants
29
+ [4bpw h6 (main)](https://huggingface.co/cgus/Qwen2.5-1.5B-Instruct-exl2/tree/main)
30
+ [4.5bpw h6](https://huggingface.co/cgus/Qwen2.5-1.5B-Instruct-exl2/tree/4.5bpw-h6)
31
+ [5bpw h6](https://huggingface.co/cgus/Qwen2.5-1.5B-Instruct-exl2/tree/5bpw-h6)
32
+ [5.5bpw h6](https://huggingface.co/cgus/Qwen2.5-1.5B-Instruct-exl2/tree/5.5bpw-h6)
33
+ [6bpw h6](https://huggingface.co/cgus/Qwen2.5-1.5B-Instruct-exl2/tree/6bpw-h6)
34
+ [6.5bpw h8](https://huggingface.co/cgus/Qwen2.5-1.5B-Instruct-exl2/tree/6.5bpw-h8)
35
+ [8bpw h8](https://huggingface.co/cgus/Qwen2.5-1.5B-Instruct-exl2/tree/8bpw-h8)
36
+
37
+ ## Quantization notes
38
+ Made with Exllamav2 0.2.4 with the default dataset.
39
+ These quants might be useful as a draft model for 32B/70B model with TabbyAPI.
40
+ Exllamav2 supports Nvidia RTX GPUs on Windows and Nvidia RTX and ROCm AMD cards on Linux.
41
+
42
+ # Qwen2.5-1.5B-Instruct
43
+
44
+ ## Introduction
45
+
46
+ 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:
47
+
48
+ - Significantly **more knowledge** and has greatly improved capabilities in **coding** and **mathematics**, thanks to our specialized expert models in these domains.
49
+ - 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.
50
+ - **Long-context Support** up to 128K tokens and can generate up to 8K tokens.
51
+ - **Multilingual support** for over 29 languages, including Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic, and more.
52
+
53
+ **This repo contains the instruction-tuned 1.5B Qwen2.5 model**, which has the following features:
54
+ - Type: Causal Language Models
55
+ - Training Stage: Pretraining & Post-training
56
+ - Architecture: transformers with RoPE, SwiGLU, RMSNorm, Attention QKV bias and tied word embeddings
57
+ - Number of Parameters: 1.54B
58
+ - Number of Paramaters (Non-Embedding): 1.31B
59
+ - Number of Layers: 28
60
+ - Number of Attention Heads (GQA): 12 for Q and 2 for KV
61
+ - Context Length: Full 32,768 tokens and generation 8192 tokens
62
+
63
+ 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/).
64
+
65
+ ## Requirements
66
+
67
+ The code of Qwen2.5 has been in the latest Hugging face `transformers` and we advise you to use the latest version of `transformers`.
68
+
69
+ With `transformers<4.37.0`, you will encounter the following error:
70
+ ```
71
+ KeyError: 'qwen2'
72
+ ```
73
+
74
+ ## Quickstart
75
+
76
+ Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
77
+
78
+ ```python
79
+ from transformers import AutoModelForCausalLM, AutoTokenizer
80
+
81
+ model_name = "Qwen/Qwen2.5-1.5B-Instruct"
82
+
83
+ model = AutoModelForCausalLM.from_pretrained(
84
+ model_name,
85
+ torch_dtype="auto",
86
+ device_map="auto"
87
+ )
88
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
89
+
90
+ prompt = "Give me a short introduction to large language model."
91
+ messages = [
92
+ {"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."},
93
+ {"role": "user", "content": prompt}
94
+ ]
95
+ text = tokenizer.apply_chat_template(
96
+ messages,
97
+ tokenize=False,
98
+ add_generation_prompt=True
99
+ )
100
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
101
+
102
+ generated_ids = model.generate(
103
+ **model_inputs,
104
+ max_new_tokens=512
105
+ )
106
+ generated_ids = [
107
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
108
+ ]
109
+
110
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
111
+ ```
112
+
113
+
114
+ ## Evaluation & Performance
115
+
116
+ Detailed evaluation results are reported in this [📑 blog](https://qwenlm.github.io/blog/qwen2.5/).
117
+
118
+ For requirements on GPU memory and the respective throughput, see results [here](https://qwen.readthedocs.io/en/latest/benchmark/speed_benchmark.html).
119
+
120
+ ## Citation
121
+
122
+ If you find our work helpful, feel free to give us a cite.
123
+
124
+ ```
125
+ @misc{qwen2.5,
126
+ title = {Qwen2.5: A Party of Foundation Models},
127
+ url = {https://qwenlm.github.io/blog/qwen2.5/},
128
+ author = {Qwen Team},
129
+ month = {September},
130
+ year = {2024}
131
+ }
132
+
133
+ @article{qwen2,
134
+ title={Qwen2 Technical Report},
135
+ 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},
136
+ journal={arXiv preprint arXiv:2407.10671},
137
+ year={2024}
138
+ }
139
  ```