Initial GGML model commit
Browse files
README.md
ADDED
@@ -0,0 +1,336 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
inference: false
|
3 |
+
license: other
|
4 |
+
---
|
5 |
+
|
6 |
+
<!-- header start -->
|
7 |
+
<div style="width: 100%;">
|
8 |
+
<img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
|
9 |
+
</div>
|
10 |
+
<div style="display: flex; justify-content: space-between; width: 100%;">
|
11 |
+
<div style="display: flex; flex-direction: column; align-items: flex-start;">
|
12 |
+
<p><a href="https://discord.gg/Jq4vkcDakD">Chat & support: my new Discord server</a></p>
|
13 |
+
</div>
|
14 |
+
<div style="display: flex; flex-direction: column; align-items: flex-end;">
|
15 |
+
<p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
|
16 |
+
</div>
|
17 |
+
</div>
|
18 |
+
<!-- header end -->
|
19 |
+
|
20 |
+
# WizardLM's WizardCoder 15B 1.0 GGML
|
21 |
+
|
22 |
+
These files are GGML format model files for [WizardLM's WizardCoder 15B 1.0](https://huggingface.co/WizardLM/WizardCoder-15B-V1.0).
|
23 |
+
|
24 |
+
GGML files are for CPU + GPU inference using [llama.cpp](https://github.com/ggerganov/llama.cpp) and libraries and UIs which support this format, such as:
|
25 |
+
* [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
|
26 |
+
* [KoboldCpp](https://github.com/LostRuins/koboldcpp)
|
27 |
+
* [ParisNeo/GPT4All-UI](https://github.com/ParisNeo/gpt4all-ui)
|
28 |
+
* [llama-cpp-python](https://github.com/abetlen/llama-cpp-python)
|
29 |
+
* [ctransformers](https://github.com/marella/ctransformers)
|
30 |
+
|
31 |
+
## Repositories available
|
32 |
+
|
33 |
+
* [4-bit GPTQ models for GPU inference](https://huggingface.co/TheBloke/WizardCoder-15B-1.0-GPTQ)
|
34 |
+
* [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference](https://huggingface.co/TheBloke/WizardCoder-15B-1.0-GGML)
|
35 |
+
* [Unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/WizardLM/WizardCoder-15B-V1.0)
|
36 |
+
|
37 |
+
<!-- compatibility_ggml start -->
|
38 |
+
## Compatibility
|
39 |
+
|
40 |
+
### Original llama.cpp quant methods: `q4_0, q4_1, q5_0, q5_1, q8_0`
|
41 |
+
|
42 |
+
I have quantized these 'original' quantisation methods using an older version of llama.cpp so that they remain compatible with llama.cpp as of May 19th, commit `2d5db48`.
|
43 |
+
|
44 |
+
They should be compatible with all current UIs and libraries that use llama.cpp, such as those listed at the top of this README.
|
45 |
+
|
46 |
+
### New k-quant methods: `q2_K, q3_K_S, q3_K_M, q3_K_L, q4_K_S, q4_K_M, q5_K_S, q6_K`
|
47 |
+
|
48 |
+
These new quantisation methods are only compatible with llama.cpp as of June 6th, commit `2d43387`.
|
49 |
+
|
50 |
+
They will NOT be compatible with koboldcpp, text-generation-ui, and other UIs and libraries yet. Support is expected to come over the next few days.
|
51 |
+
|
52 |
+
## Explanation of the new k-quant methods
|
53 |
+
|
54 |
+
The new methods available are:
|
55 |
+
* GGML_TYPE_Q2_K - "type-1" 2-bit quantization in super-blocks containing 16 blocks, each block having 16 weight. Block scales and mins are quantized with 4 bits. This ends up effectively using 2.5625 bits per weight (bpw)
|
56 |
+
* GGML_TYPE_Q3_K - "type-0" 3-bit quantization in super-blocks containing 16 blocks, each block having 16 weights. Scales are quantized with 6 bits. This end up using 3.4375 bpw.
|
57 |
+
* GGML_TYPE_Q4_K - "type-1" 4-bit quantization in super-blocks containing 8 blocks, each block having 32 weights. Scales and mins are quantized with 6 bits. This ends up using 4.5 bpw.
|
58 |
+
* GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
|
59 |
+
* GGML_TYPE_Q6_K - "type-0" 6-bit quantization. Super-blocks with 16 blocks, each block having 16 weights. Scales are quantized with 8 bits. This ends up using 6.5625 bpw
|
60 |
+
* GGML_TYPE_Q8_K - "type-0" 8-bit quantization. Only used for quantizing intermediate results. The difference to the existing Q8_0 is that the block size is 256. All 2-6 bit dot products are implemented for this quantization type.
|
61 |
+
|
62 |
+
Refer to the Provided Files table below to see what files use which methods, and how.
|
63 |
+
<!-- compatibility_ggml end -->
|
64 |
+
|
65 |
+
## Provided files
|
66 |
+
| Name | Quant method | Bits | Size | Max RAM required | Use case |
|
67 |
+
| ---- | ---- | ---- | ---- | ---- | ----- |
|
68 |
+
| wizardcoder.ggmlv3.q4_0.bin | q4_0 | 4 | 10.75 GB | 13.25 GB | Original llama.cpp quant method, 4-bit. |
|
69 |
+
| wizardcoder.ggmlv3.q4_1.bin | q4_1 | 4 | 11.92 GB | 14.42 GB | Original llama.cpp quant method, 4-bit. Higher accuracy than q4_0 but not as high as q5_0. However has quicker inference than q5 models. |
|
70 |
+
| wizardcoder.ggmlv3.q5_0.bin | q5_0 | 5 | 13.09 GB | 15.59 GB | Original llama.cpp quant method, 5-bit. Higher accuracy, higher resource usage and slower inference. |
|
71 |
+
| wizardcoder.ggmlv3.q5_1.bin | q5_1 | 5 | 14.26 GB | 16.76 GB | Original llama.cpp quant method, 5-bit. Even higher accuracy, resource usage and slower inference. |
|
72 |
+
| wizardcoder.ggmlv3.q8_0.bin | q8_0 | 8 | 20.11 GB | 22.61 GB | Original llama.cpp quant method, 8-bit. Almost indistinguishable from float16. High resource use and slow. Not recommended for most users. |
|
73 |
+
|
74 |
+
|
75 |
+
**Note**: the above RAM figures assume no GPU offloading. If layers are offloaded to the GPU, this will reduce RAM usage and use VRAM instead.
|
76 |
+
|
77 |
+
## How to run in `llama.cpp`
|
78 |
+
|
79 |
+
I use the following command line; adjust for your tastes and needs:
|
80 |
+
|
81 |
+
```
|
82 |
+
./main -t 10 -ngl 32 -m wizardcoder-15b.ggmlv3.q5_0.bin --color -c 2048 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "### Instruction: Write a story about llamas\n### Response:"
|
83 |
+
```
|
84 |
+
Change `-t 10` to the number of physical CPU cores you have. For example if your system has 8 cores/16 threads, use `-t 8`.
|
85 |
+
|
86 |
+
Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
|
87 |
+
|
88 |
+
If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
|
89 |
+
|
90 |
+
## How to run in `text-generation-webui`
|
91 |
+
|
92 |
+
Further instructions here: [text-generation-webui/docs/llama.cpp-models.md](https://github.com/oobabooga/text-generation-webui/blob/main/docs/llama.cpp-models.md).
|
93 |
+
|
94 |
+
<!-- footer start -->
|
95 |
+
## Discord
|
96 |
+
|
97 |
+
For further support, and discussions on these models and AI in general, join us at:
|
98 |
+
|
99 |
+
[TheBloke AI's Discord server](https://discord.gg/Jq4vkcDakD)
|
100 |
+
|
101 |
+
## Thanks, and how to contribute.
|
102 |
+
|
103 |
+
Thanks to the [chirper.ai](https://chirper.ai) team!
|
104 |
+
|
105 |
+
I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
|
106 |
+
|
107 |
+
If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
|
108 |
+
|
109 |
+
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
|
110 |
+
|
111 |
+
* Patreon: https://patreon.com/TheBlokeAI
|
112 |
+
* Ko-Fi: https://ko-fi.com/TheBlokeAI
|
113 |
+
|
114 |
+
**Special thanks to**: Luke from CarbonQuill, Aemon Algiz, Dmitriy Samsonov.
|
115 |
+
|
116 |
+
**Patreon special mentions**: Oscar Rangel, Eugene Pentland, Talal Aujan, Cory Kujawski, Luke, Asp the Wyvern, Ai Maven, Pyrater, Alps Aficionado, senxiiz, Willem Michiel, Junyu Yang, trip7s trip, Sebastain Graf, Joseph William Delisle, Lone Striker, Jonathan Leane, Johann-Peter Hartmann, David Flickinger, Spiking Neurons AB, Kevin Schuppel, Mano Prime, Dmitriy Samsonov, Sean Connelly, Nathan LeClaire, Alain Rossmann, Fen Risland, Derek Yates, Luke Pendergrass, Nikolai Manek, Khalefa Al-Ahmad, Artur Olbinski, John Detwiler, Ajan Kanaga, Imad Khwaja, Trenton Dambrowitz, Kalila, vamX, webtim, Illia Dulskyi.
|
117 |
+
|
118 |
+
Thank you to all my generous patrons and donaters!
|
119 |
+
|
120 |
+
<!-- footer end -->
|
121 |
+
|
122 |
+
# Original model card: WizardLM's WizardCoder 15B 1.0
|
123 |
+
|
124 |
+
# WizardCoder: Empowering Code Large Language Models with Evol-Instruct
|
125 |
+
|
126 |
+
[](https://github.com/tatsu-lab/stanford_alpaca/blob/main/LICENSE)
|
127 |
+
[](https://github.com/tatsu-lab/stanford_alpaca/blob/main/DATA_LICENSE)
|
128 |
+
[](https://www.python.org/downloads/release/python-390/)
|
129 |
+
|
130 |
+
To develop our WizardCoder model, we begin by adapting the Evol-Instruct method specifically for coding tasks. This involves tailoring the prompt to the domain of code-related instructions. Subsequently, we fine-tune the Code LLM, StarCoder, utilizing the newly created instruction-following training set.
|
131 |
+
|
132 |
+
## News
|
133 |
+
|
134 |
+
- 🔥 Our **WizardCoder-15B-v1.0** model achieves the **57.3 pass@1** on the [HumanEval Benchmarks](https://github.com/openai/human-eval), which is **22.3** points higher than the SOTA open-source Code LLMs.
|
135 |
+
- 🔥 We released **WizardCoder-15B-v1.0** trained with **78k** evolved code instructions. Please checkout the [Model Weights](https://huggingface.co/WizardLM/WizardCoder-15B-V1.0), [Demo](https://1c48cbf5c83110ed.gradio.app/), and [Paper]().
|
136 |
+
- 📣 Please refer to our Twitter account https://twitter.com/WizardLM_AI and HuggingFace Repo https://huggingface.co/WizardLM . We will use them to announce any new release at the 1st time.
|
137 |
+
|
138 |
+
|
139 |
+
## Comparing WizardCoder with the Closed-Source Models.
|
140 |
+
|
141 |
+
The SOTA LLMs for code generation, such as GPT4, Claude, and Bard, are predominantly closed-source. Acquiring access to the APIs of these models proves challenging. In this study, we adopt an alternative approach by retrieving the scores for HumanEval and HumanEval+ from the [LLM-Humaneval-Benchmarks](https://github.com/my-other-github-account/llm-humaneval-benchmarks). Notably, all the mentioned models generate code solutions for each problem utilizing a single attempt, and the resulting pass rate percentage is reported. Our **WizardCoder** generates answers using greedy decoding.
|
142 |
+
|
143 |
+
🔥 The following figure shows that our **WizardCoder attains the third position in this benchmark**, surpassing Claude-Plus (59.8 vs. 53.0) and Bard (59.8 vs. 44.5). Notably, our model exhibits a substantially smaller size compared to these models.
|
144 |
+
|
145 |
+
<p align="center" width="100%">
|
146 |
+
<a ><img src="imgs/pass1.png" alt="WizardCoder" style="width: 86%; min-width: 300px; display: block; margin: auto;"></a>
|
147 |
+
</p>
|
148 |
+
|
149 |
+
## Comparing WizardCoder with the Open-Source Models.
|
150 |
+
|
151 |
+
The following table conducts a comprehensive comparison of our **WizardCoder** with other models on the HumanEval and MBPP benchmarks. We adhere to the approach outlined in previous studies by generating n samples for each problem to estimate the pass@1 score. The findings clearly demonstrate that our **WizardCoder** exhibits a substantial performance advantage over all the open-source models.
|
152 |
+
|
153 |
+
|
154 |
+
| Model | HumanEval Pass@1 | MBPP Pass@1 |
|
155 |
+
|------------------|------------------|-------------|
|
156 |
+
| CodeGen-16B-Multi| 18.3 |20.9 |
|
157 |
+
| CodeGeeX | 22.9 |24.4 |
|
158 |
+
| LLaMA-33B | 21.7 |30.2 |
|
159 |
+
| LLaMA-65B | 23.7 |37.7 |
|
160 |
+
| PaLM-540B | 26.2 |36.8 |
|
161 |
+
| PaLM-Coder-540B | 36.0 |47.0 |
|
162 |
+
| PaLM 2-S | 37.6 |50.0 |
|
163 |
+
| CodeGen-16B-Mono | 29.3 |35.3 |
|
164 |
+
| Code-Cushman-001 | 33.5 |45.9 |
|
165 |
+
| StarCoder-15B | 33.6 |43.6* |
|
166 |
+
| InstructCodeT5+ | 35.0 |-- |
|
167 |
+
| WizardLM-30B 1.0| 37.8 |-- |
|
168 |
+
| WizardCoder-15B 1.0 | **57.3** |**51.8** |
|
169 |
+
|
170 |
+
*: The reproduced result of StarCoder on MBPP.
|
171 |
+
|
172 |
+
## Call for Feedbacks
|
173 |
+
We welcome everyone to use your professional and difficult instructions to evaluate WizardCoder, and show us examples of poor performance and your suggestions in the [issue discussion](https://github.com/nlpxucan/WizardLM/issues) area. We are focusing on improving the Evol-Instruct now and hope to relieve existing weaknesses and issues in the the next version of WizardCoder. After that, we will open the code and pipeline of up-to-date Evol-Instruct algorithm and work with you together to improve it.
|
174 |
+
|
175 |
+
|
176 |
+
## Contents
|
177 |
+
|
178 |
+
1. [Online Demo](#online-demo)
|
179 |
+
|
180 |
+
2. [Fine-tuning](#fine-tuning)
|
181 |
+
|
182 |
+
3. [Inference](#inference)
|
183 |
+
|
184 |
+
4. [Evaluation](#evaluation)
|
185 |
+
|
186 |
+
5. [Citation](#citation)
|
187 |
+
|
188 |
+
6. [Disclaimer](#disclaimer)
|
189 |
+
|
190 |
+
## Online Demo
|
191 |
+
|
192 |
+
We will provide our latest models for you to try for as long as possible. If you find a link is not working, please try another one. At the same time, please try as many **real-world** and **challenging** code-related problems that you encounter in your work and life as possible. We will continue to evolve our models with your feedbacks.
|
193 |
+
|
194 |
+
[Demo Link](https://1c48cbf5c83110ed.gradio.app/) (We adopt the greedy decoding now.)
|
195 |
+
|
196 |
+
## Fine-tuning
|
197 |
+
|
198 |
+
We fine-tune WizardCoder using the modified code `train.py` from [Llama-X](https://github.com/AetherCortex/Llama-X).
|
199 |
+
We fine-tune StarCoder-15B with the following hyperparameters:
|
200 |
+
|
201 |
+
| Hyperparameter | StarCoder-15B |
|
202 |
+
|----------------|---------------|
|
203 |
+
| Batch size | 512 |
|
204 |
+
| Learning rate | 2e-5 |
|
205 |
+
| Epochs | 3 |
|
206 |
+
| Max length | 2048 |
|
207 |
+
| Warmup step | 30 |
|
208 |
+
| LR scheduler | cosine |
|
209 |
+
|
210 |
+
To reproduce our fine-tuning of WizardCoder, please follow the following steps:
|
211 |
+
1. According to the instructions of [Llama-X](https://github.com/AetherCortex/Llama-X), install the environment, download the training code, and deploy. (Note: `deepspeed==0.9.2` and `transformers==4.29.2`)
|
212 |
+
2. Replace the `train.py` with the `train_wizardcoder.py` in our repo (`src/train_wizardcoder.py`)
|
213 |
+
3. Login Huggingface:
|
214 |
+
```bash
|
215 |
+
huggingface-cli login
|
216 |
+
```
|
217 |
+
4. Execute the following training command:
|
218 |
+
```bash
|
219 |
+
deepspeed train_wizardcoder.py \
|
220 |
+
--model_name_or_path "bigcode/starcoder" \
|
221 |
+
--data_path "/your/path/to/code_instruction_data.json" \
|
222 |
+
--output_dir "/your/path/to/ckpt" \
|
223 |
+
--num_train_epochs 3 \
|
224 |
+
--model_max_length 2048 \
|
225 |
+
--per_device_train_batch_size 16 \
|
226 |
+
--per_device_eval_batch_size 1 \
|
227 |
+
--gradient_accumulation_steps 4 \
|
228 |
+
--evaluation_strategy "no" \
|
229 |
+
--save_strategy "steps" \
|
230 |
+
--save_steps 50 \
|
231 |
+
--save_total_limit 2 \
|
232 |
+
--learning_rate 2e-5 \
|
233 |
+
--warmup_steps 30 \
|
234 |
+
--logging_steps 2 \
|
235 |
+
--lr_scheduler_type "cosine" \
|
236 |
+
--report_to "tensorboard" \
|
237 |
+
--gradient_checkpointing True \
|
238 |
+
--deepspeed configs/deepspeed_config.json \
|
239 |
+
--fp16 True
|
240 |
+
```
|
241 |
+
|
242 |
+
## Inference
|
243 |
+
|
244 |
+
We provide the decoding script for WizardCoder, which reads a input file and generates corresponding responses for each sample, and finally consolidates them into an output file.
|
245 |
+
|
246 |
+
You can specify `base_model`, `input_data_path` and `output_data_path` in `src\inference_wizardcoder.py` to set the decoding model, path of input file and path of output file.
|
247 |
+
|
248 |
+
```bash
|
249 |
+
pip install jsonlines
|
250 |
+
```
|
251 |
+
|
252 |
+
The decoding command is:
|
253 |
+
```
|
254 |
+
python src\inference_wizardcoder.py \
|
255 |
+
--base_model "/your/path/to/ckpt" \
|
256 |
+
--input_data_path "/your/path/to/input/data.jsonl" \
|
257 |
+
--output_data_path "/your/path/to/output/result.jsonl"
|
258 |
+
```
|
259 |
+
|
260 |
+
The format of `data.jsonl` should be:
|
261 |
+
```
|
262 |
+
{"idx": 11, "Instruction": "Write a Python code to count 1 to 10."}
|
263 |
+
{"idx": 12, "Instruction": "Write a Jave code to sum 1 to 10."}
|
264 |
+
```
|
265 |
+
|
266 |
+
The prompt for our WizardCoder in `src\inference_wizardcoder.py` is:
|
267 |
+
```
|
268 |
+
Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
269 |
+
|
270 |
+
### Instruction:
|
271 |
+
{instruction}
|
272 |
+
|
273 |
+
### Response:
|
274 |
+
```
|
275 |
+
|
276 |
+
## Evaluation
|
277 |
+
|
278 |
+
We provide the evaluation script on HumanEval for WizardCoder.
|
279 |
+
|
280 |
+
1. According to the instructions of [HumanEval](https://github.com/openai/human-eval), install the environment.
|
281 |
+
2. Run the following script to generate the answer.
|
282 |
+
```bash
|
283 |
+
model="/path/to/your/model"
|
284 |
+
temp=0.2
|
285 |
+
max_len=2048
|
286 |
+
pred_num=200
|
287 |
+
num_seqs_per_iter=2
|
288 |
+
|
289 |
+
output_path=preds/T${temp}_N${pred_num}
|
290 |
+
|
291 |
+
mkdir -p ${output_path}
|
292 |
+
echo 'Output path: '$output_path
|
293 |
+
echo 'Model to eval: '$model
|
294 |
+
|
295 |
+
# 164 problems, 21 per GPU if GPU=8
|
296 |
+
index=0
|
297 |
+
gpu_num=8
|
298 |
+
for ((i = 0; i < $gpu_num; i++)); do
|
299 |
+
start_index=$((i * 21))
|
300 |
+
end_index=$(((i + 1) * 21))
|
301 |
+
|
302 |
+
gpu=$((i))
|
303 |
+
echo 'Running process #' ${i} 'from' $start_index 'to' $end_index 'on GPU' ${gpu}
|
304 |
+
((index++))
|
305 |
+
(
|
306 |
+
CUDA_VISIBLE_DEVICES=$gpu python humaneval_gen.py --model ${model} \
|
307 |
+
--start_index ${start_index} --end_index ${end_index} --temperature ${temp} \
|
308 |
+
--num_seqs_per_iter ${num_seqs_per_iter} --N ${pred_num} --max_len ${max_len} --output_path ${output_path}
|
309 |
+
) &
|
310 |
+
if (($index % $gpu_num == 0)); then wait; fi
|
311 |
+
done
|
312 |
+
```
|
313 |
+
3. Run the post processing code `src/process_humaneval.py` to collect the code completions from all answer files.
|
314 |
+
```bash
|
315 |
+
output_path=preds/T${temp}_N${pred_num}
|
316 |
+
|
317 |
+
echo 'Output path: '$output_path
|
318 |
+
python process_humaneval.py --path ${output_path} --out_path ${output_path}.jsonl --add_prompt
|
319 |
+
|
320 |
+
evaluate_functional_correctness ${output_path}.jsonl
|
321 |
+
```
|
322 |
+
|
323 |
+
## Citation
|
324 |
+
|
325 |
+
Please cite the repo if you use the data or code in this repo.
|
326 |
+
|
327 |
+
```
|
328 |
+
@misc{luo2023wizardcoder,
|
329 |
+
title={WizardCoder: Empowering Code Large Language Models with Evol-Instruct},
|
330 |
+
author={Ziyang Luo and Can Xu and Pu Zhao and Qingfeng Sun and Xiubo Geng and Wenxiang Hu and Chongyang Tao and Jing Ma and Qingwei Lin and Daxin Jiang},
|
331 |
+
year={2023},
|
332 |
+
}
|
333 |
+
```
|
334 |
+
## Disclaimer
|
335 |
+
|
336 |
+
The resources, including code, data, and model weights, associated with this project are restricted for academic research purposes only and cannot be used for commercial purposes. The content produced by any version of WizardCoder is influenced by uncontrollable variables such as randomness, and therefore, the accuracy of the output cannot be guaranteed by this project. This project does not accept any legal liability for the content of the model output, nor does it assume responsibility for any losses incurred due to the use of associated resources and output results.
|