RichardErkhov commited on
Commit
3176721
1 Parent(s): 99726f8

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +180 -0
README.md ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ Qwen2.5-Coder-7B-Instruct - GGUF
11
+ - Model creator: https://huggingface.co/Qwen/
12
+ - Original model: https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct/
13
+
14
+
15
+ | Name | Quant method | Size |
16
+ | ---- | ---- | ---- |
17
+ | [Qwen2.5-Coder-7B-Instruct.Q2_K.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.Q2_K.gguf) | Q2_K | 2.81GB |
18
+ | [Qwen2.5-Coder-7B-Instruct.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.IQ3_XS.gguf) | IQ3_XS | 3.12GB |
19
+ | [Qwen2.5-Coder-7B-Instruct.IQ3_S.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.IQ3_S.gguf) | IQ3_S | 3.26GB |
20
+ | [Qwen2.5-Coder-7B-Instruct.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.Q3_K_S.gguf) | Q3_K_S | 3.25GB |
21
+ | [Qwen2.5-Coder-7B-Instruct.IQ3_M.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.IQ3_M.gguf) | IQ3_M | 3.33GB |
22
+ | [Qwen2.5-Coder-7B-Instruct.Q3_K.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.Q3_K.gguf) | Q3_K | 3.55GB |
23
+ | [Qwen2.5-Coder-7B-Instruct.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.Q3_K_M.gguf) | Q3_K_M | 3.55GB |
24
+ | [Qwen2.5-Coder-7B-Instruct.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.Q3_K_L.gguf) | Q3_K_L | 3.81GB |
25
+ | [Qwen2.5-Coder-7B-Instruct.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.IQ4_XS.gguf) | IQ4_XS | 3.96GB |
26
+ | [Qwen2.5-Coder-7B-Instruct.Q4_0.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.Q4_0.gguf) | Q4_0 | 4.13GB |
27
+ | [Qwen2.5-Coder-7B-Instruct.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.IQ4_NL.gguf) | IQ4_NL | 4.16GB |
28
+ | [Qwen2.5-Coder-7B-Instruct.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.Q4_K_S.gguf) | Q4_K_S | 4.15GB |
29
+ | [Qwen2.5-Coder-7B-Instruct.Q4_K.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.Q4_K.gguf) | Q4_K | 4.36GB |
30
+ | [Qwen2.5-Coder-7B-Instruct.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.Q4_K_M.gguf) | Q4_K_M | 4.36GB |
31
+ | [Qwen2.5-Coder-7B-Instruct.Q4_1.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.Q4_1.gguf) | Q4_1 | 4.54GB |
32
+ | [Qwen2.5-Coder-7B-Instruct.Q5_0.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.Q5_0.gguf) | Q5_0 | 4.95GB |
33
+ | [Qwen2.5-Coder-7B-Instruct.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.Q5_K_S.gguf) | Q5_K_S | 4.95GB |
34
+ | [Qwen2.5-Coder-7B-Instruct.Q5_K.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.Q5_K.gguf) | Q5_K | 5.07GB |
35
+ | [Qwen2.5-Coder-7B-Instruct.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.Q5_K_M.gguf) | Q5_K_M | 5.07GB |
36
+ | [Qwen2.5-Coder-7B-Instruct.Q5_1.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.Q5_1.gguf) | Q5_1 | 5.36GB |
37
+ | [Qwen2.5-Coder-7B-Instruct.Q6_K.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.Q6_K.gguf) | Q6_K | 5.82GB |
38
+ | [Qwen2.5-Coder-7B-Instruct.Q8_0.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2.5-Coder-7B-Instruct-gguf/blob/main/Qwen2.5-Coder-7B-Instruct.Q8_0.gguf) | Q8_0 | 7.54GB |
39
+
40
+
41
+
42
+
43
+ Original model description:
44
+ ---
45
+ license: apache-2.0
46
+ license_link: https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct/blob/main/LICENSE
47
+ language:
48
+ - en
49
+ base_model:
50
+ - Qwen/Qwen2.5-Coder-7B
51
+ pipeline_tag: text-generation
52
+ library_name: transformers
53
+ tags:
54
+ - code
55
+ - codeqwen
56
+ - chat
57
+ - qwen
58
+ - qwen-coder
59
+ ---
60
+
61
+
62
+ # Qwen2.5-Coder-7B-Instruct
63
+
64
+ ## Introduction
65
+
66
+ Qwen2.5-Coder is the latest series of Code-Specific Qwen large language models (formerly known as CodeQwen). For Qwen2.5-Coder, we release three base language models and instruction-tuned language models, 1.5, 7 and 32 (coming soon) billion parameters. Qwen2.5-Coder brings the following improvements upon CodeQwen1.5:
67
+
68
+ - Significantly improvements in **code generation**, **code reasoning** and **code fixing**. Base on the strong Qwen2.5, we scale up the training tokens into 5.5 trillion including source code, text-code grounding, Synthetic data, etc.
69
+ - A more comprehensive foundation for real-world applications such as **Code Agents**. Not only enhancing coding capabilities but also maintaining its strengths in mathematics and general competencies.
70
+ - **Long-context Support** up to 128K tokens.
71
+
72
+ **This repo contains the instruction-tuned 7B Qwen2.5-Coder 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: 7.61B
77
+ - Number of Paramaters (Non-Embedding): 6.53B
78
+ - Number of Layers: 28
79
+ - Number of Attention Heads (GQA): 28 for Q and 4 for KV
80
+ - Context Length: Full 131,072 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-coder/), [GitHub](https://github.com/QwenLM/Qwen2.5-Coder), and [Documentation](https://qwen.readthedocs.io/en/latest/).
84
+
85
+ ## Requirements
86
+
87
+ The code of Qwen2.5-Coder 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-Coder-7B-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 = "write a quick sort algorithm."
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-coder/).
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
+ @article{qwen25_coder,
167
+ title={Qwen2.5-Coder Technical Report},
168
+ author={Binyuan Hui, Jian Yang, Zeyu Cui, Jiaxi Yang, Dayiheng Liu, Lei Zhang, Tianyu Liu, Jiajun Zhang, Bowen Yu, Kai Dang, An Yang, Rui Men, Fei Huang, Xingzhang Ren, Xuancheng Ren, Jingren Zhou and Junyang Lin},
169
+ journal={arXiv preprint arXiv:2409.12186},
170
+ year={2024}
171
+ }
172
+ @article{qwen2,
173
+ title={Qwen2 Technical Report},
174
+ 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},
175
+ journal={arXiv preprint arXiv:2407.10671},
176
+ year={2024}
177
+ }
178
+ ```
179
+
180
+