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