ThomasBaruzier commited on
Commit
eac7f9b
·
verified ·
1 Parent(s): e21a4e8

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +182 -0
README.md ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ license_link: https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct/blob/main/LICENSE
4
+ language:
5
+ - en
6
+ base_model:
7
+ - Qwen/Qwen2.5-Coder-7B
8
+ pipeline_tag: text-generation
9
+ library_name: transformers
10
+ tags:
11
+ - code
12
+ - codeqwen
13
+ - chat
14
+ - qwen
15
+ - qwen-coder
16
+ ---
17
+
18
+ <br><img src="https://cdn-uploads.huggingface.co/production/uploads/646410e04bf9122922289dc7/wHRc2ZKSErOs92ZcdKQrY.webp" width="720"><br>
19
+
20
+ # Llama.cpp imatrix quantizations of [Qwen/Qwen2.5-Coder-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct)
21
+
22
+ Using llama.cpp commit [3ad5451](https://github.com/ggerganov/llama.cpp/commit/3ad5451) for quantization.
23
+
24
+ All quants were made using the imatrix option and Bartowski's [calibration file](https://gist.github.com/bartowski1182/eb213dccb3571f863da82e99418f81e8).
25
+
26
+ <hr>
27
+
28
+ # Perplexity table (the lower the better)
29
+
30
+ | Quant | Size (MB) | PPL | Size (%) | Accuracy (%) | PPL error rate |
31
+ | -------------------------------------------------------------------------------------------------------------------------------- | --------- | ------- | -------- | ------------ | -------------- |
32
+ | [IQ1_S](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-IQ1_S.gguf) | 1815 | 18.3139 | 12.49 | 50.82 | 0.29 |
33
+ | [IQ1_M](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-IQ1_M.gguf) | 1947 | 14.7056 | 13.40 | 63.29 | 0.24 |
34
+ | [IQ2_XXS](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-IQ2_XXS.gguf) | 2167 | 12.3126 | 14.91 | 75.59 | 0.20 |
35
+ | [IQ2_XS](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-IQ2_XS.gguf) | 2354 | 11.0302 | 16.20 | 84.38 | 0.17 |
36
+ | [IQ2_S](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-IQ2_S.gguf) | 2475 | 10.7236 | 17.03 | 86.79 | 0.17 |
37
+ | [IQ2_M](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-IQ2_M.gguf) | 2651 | 10.3509 | 18.24 | 89.92 | 0.16 |
38
+ | [Q2_K_S](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-Q2_K_S.gguf) | 2702 | 10.6991 | 18.59 | 86.99 | 0.17 |
39
+ | [Q2_K](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-Q2_K.gguf) | 2876 | 10.3696 | 19.79 | 89.75 | 0.16 |
40
+ | [IQ3_XXS](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-IQ3_XXS.gguf) | 2970 | 9.8351 | 20.44 | 94.63 | 0.15 |
41
+ | [IQ3_XS](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-IQ3_XS.gguf) | 3191 | 9.5737 | 21.96 | 97.21 | 0.15 |
42
+ | [Q3_K_S](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-Q3_K_S.gguf) | 3330 | 9.7610 | 22.92 | 95.35 | 0.15 |
43
+ | [IQ3_S](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-IQ3_S.gguf) | 3337 | 9.5520 | 22.96 | 97.44 | 0.15 |
44
+ | [IQ3_M](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-IQ3_M.gguf) | 3408 | 9.5248 | 23.45 | 97.71 | 0.15 |
45
+ | [Q3_K_M](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-Q3_K_M.gguf) | 3631 | 9.6151 | 24.99 | 96.80 | 0.15 |
46
+ | [Q3_K_L](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-Q3_K_L.gguf) | 3899 | 9.5675 | 26.83 | 97.28 | 0.15 |
47
+ | [IQ4_XS](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-IQ4_XS.gguf) | 4023 | 9.3942 | 27.68 | 99.07 | 0.15 |
48
+ | [IQ4_NL](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-IQ4_NL.gguf) | 4232 | 9.3991 | 29.12 | 99.02 | 0.15 |
49
+ | [Q4_0](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-Q4_0.gguf) | 4238 | 9.4483 | 29.17 | 98.50 | 0.15 |
50
+ | [Q4_K_S](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-Q4_K_S.gguf) | 4251 | 9.3869 | 29.25 | 99.15 | 0.15 |
51
+ | [Q4_K_M](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-Q4_K_M.gguf) | 4466 | 9.3699 | 30.73 | 99.33 | 0.15 |
52
+ | [Q4_1](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-Q4_1.gguf) | 4647 | 9.3797 | 31.98 | 99.22 | 0.15 |
53
+ | [Q5_K_S](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-Q5_K_S.gguf) | 5068 | 9.3144 | 34.88 | 99.92 | 0.14 |
54
+ | [Q5_0](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-Q5_0.gguf) | 5081 | 9.3419 | 34.97 | 99.63 | 0.14 |
55
+ | [Q5_K_M](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-Q5_K_M.gguf) | 5192 | 9.3152 | 35.73 | 99.91 | 0.14 |
56
+ | [Q5_1](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-Q5_1.gguf) | 5490 | 9.3111 | 37.78 | 99.96 | 0.14 |
57
+ | [Q6_K](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-Q6_K.gguf) | 5964 | 9.3168 | 41.04 | 99.89 | 0.14 |
58
+ | [Q8_0](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-Q8_0.gguf) | 7723 | 9.3061 | 53.15 | 100.01 | 0.14 |
59
+ | [F16](https://huggingface.co/ThomasBaruzier/Qwen2.5-Coder-7B-Instruct-GGUF/blob/main/Qwen2.5-Coder-7B-Instruct-F16.gguf) | 14531 | 9.3071 | 100 | 100 | 0.14 |
60
+
61
+ <hr>
62
+
63
+ # Qwen2.5-Coder-7B-Instruct
64
+ <a href="https://chat.qwenlm.ai/" target="_blank" style="margin: 2px;">
65
+ <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;"/>
66
+ </a>
67
+
68
+ ## Introduction
69
+
70
+ Qwen2.5-Coder is the latest series of Code-Specific Qwen large language models (formerly known as CodeQwen). As of now, Qwen2.5-Coder has covered six mainstream model sizes, 0.5, 1.5, 3, 7, 14, 32 billion parameters, to meet the needs of different developers. Qwen2.5-Coder brings the following improvements upon CodeQwen1.5:
71
+
72
+ - 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. Qwen2.5-Coder-32B has become the current state-of-the-art open-source codeLLM, with its coding abilities matching those of GPT-4o.
73
+ - 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.
74
+ - **Long-context Support** up to 128K tokens.
75
+
76
+ **This repo contains the instruction-tuned 7B Qwen2.5-Coder model**, which has the following features:
77
+ - Type: Causal Language Models
78
+ - Training Stage: Pretraining & Post-training
79
+ - Architecture: transformers with RoPE, SwiGLU, RMSNorm, and Attention QKV bias
80
+ - Number of Parameters: 7.61B
81
+ - Number of Paramaters (Non-Embedding): 6.53B
82
+ - Number of Layers: 28
83
+ - Number of Attention Heads (GQA): 28 for Q and 4 for KV
84
+ - Context Length: Full 131,072 tokens
85
+ - Please refer to [this section](#processing-long-texts) for detailed instructions on how to deploy Qwen2.5 for handling long texts.
86
+
87
+ For more details, please refer to our [blog](https://qwenlm.github.io/blog/qwen2.5-coder-family/), [GitHub](https://github.com/QwenLM/Qwen2.5-Coder), [Documentation](https://qwen.readthedocs.io/en/latest/), [Arxiv](https://arxiv.org/abs/2409.12186).
88
+
89
+ ## Requirements
90
+
91
+ 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`.
92
+
93
+ With `transformers<4.37.0`, you will encounter the following error:
94
+ ```
95
+ KeyError: 'qwen2'
96
+ ```
97
+
98
+ ## Quickstart
99
+
100
+ Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
101
+
102
+ ```python
103
+ from transformers import AutoModelForCausalLM, AutoTokenizer
104
+
105
+ model_name = "Qwen/Qwen2.5-Coder-7B-Instruct"
106
+
107
+ model = AutoModelForCausalLM.from_pretrained(
108
+ model_name,
109
+ torch_dtype="auto",
110
+ device_map="auto"
111
+ )
112
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
113
+
114
+ prompt = "write a quick sort algorithm."
115
+ messages = [
116
+ {"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."},
117
+ {"role": "user", "content": prompt}
118
+ ]
119
+ text = tokenizer.apply_chat_template(
120
+ messages,
121
+ tokenize=False,
122
+ add_generation_prompt=True
123
+ )
124
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
125
+
126
+ generated_ids = model.generate(
127
+ **model_inputs,
128
+ max_new_tokens=512
129
+ )
130
+ generated_ids = [
131
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
132
+ ]
133
+
134
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
135
+ ```
136
+
137
+ ### Processing Long Texts
138
+
139
+ The current `config.json` is set for context length up to 32,768 tokens.
140
+ 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.
141
+
142
+ For supported frameworks, you could add the following to `config.json` to enable YaRN:
143
+ ```json
144
+ {
145
+ ...,
146
+ "rope_scaling": {
147
+ "factor": 4.0,
148
+ "original_max_position_embeddings": 32768,
149
+ "type": "yarn"
150
+ }
151
+ }
152
+ ```
153
+
154
+ For deployment, we recommend using vLLM.
155
+ Please refer to our [Documentation](https://qwen.readthedocs.io/en/latest/deployment/vllm.html) for usage if you are not familar with vLLM.
156
+ Presently, vLLM only supports static YARN, which means the scaling factor remains constant regardless of input length, **potentially impacting performance on shorter texts**.
157
+ We advise adding the `rope_scaling` configuration only when processing long contexts is required.
158
+
159
+ ## Evaluation & Performance
160
+
161
+ Detailed evaluation results are reported in this [📑 blog](https://qwenlm.github.io/blog/qwen2.5-coder-family/).
162
+
163
+ For requirements on GPU memory and the respective throughput, see results [here](https://qwen.readthedocs.io/en/latest/benchmark/speed_benchmark.html).
164
+
165
+ ## Citation
166
+
167
+ If you find our work helpful, feel free to give us a cite.
168
+
169
+ ```
170
+ @article{hui2024qwen2,
171
+ title={Qwen2. 5-Coder Technical Report},
172
+ author={Hui, Binyuan and Yang, Jian and Cui, Zeyu and Yang, Jiaxi and Liu, Dayiheng and Zhang, Lei and Liu, Tianyu and Zhang, Jiajun and Yu, Bowen and Dang, Kai and others},
173
+ journal={arXiv preprint arXiv:2409.12186},
174
+ year={2024}
175
+ }
176
+ @article{qwen2,
177
+ title={Qwen2 Technical Report},
178
+ 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},
179
+ journal={arXiv preprint arXiv:2407.10671},
180
+ year={2024}
181
+ }
182
+ ```