commit for readme
Browse files
README.md
CHANGED
@@ -4,4 +4,100 @@ datasets:
|
|
4 |
- nickrosh/Evol-Instruct-Code-80k-v1
|
5 |
language:
|
6 |
- en
|
7 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
- nickrosh/Evol-Instruct-Code-80k-v1
|
5 |
language:
|
6 |
- en
|
7 |
+
---
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
# epinnock/WizardCoder-1B-merged
|
12 |
+
|
13 |
+
## Table of Contents
|
14 |
+
|
15 |
+
1. [Model Summary](##model-summary)
|
16 |
+
2. [Use](##use)
|
17 |
+
3. [Limitations](##limitations)
|
18 |
+
4. [Training](##training)
|
19 |
+
5. [License](##license)
|
20 |
+
|
21 |
+
|
22 |
+
## Model Summary
|
23 |
+
|
24 |
+
|
25 |
+
1B version of [StarCoderBase](https://huggingface.co/bigcode/starcoderbase). LoRa finetuned on Evol-Instruct-Code-80k-v1 dataset generated using the [Evol-Teacher](https://github.com/nickrosh/evol-teacher) repo.
|
26 |
+
Based on Previous works of @WizardLM
|
27 |
+
|
28 |
+
- **Training Report:** [wandb](https://wandb.ai/aetherfoundry/huggingface/reports/Training-Report--Vmlldzo1MDUwOTcx)
|
29 |
+
- **Repository:** [bigcode/Starcoder](https://github.com/bigcode-project/starcoder)
|
30 |
+
- **Project Website:** [bigcode-project.org](https://www.bigcode-project.org)
|
31 |
+
|
32 |
+
|
33 |
+
## Use
|
34 |
+
|
35 |
+
### Generation
|
36 |
+
```python
|
37 |
+
# pip install -q transformers
|
38 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
39 |
+
|
40 |
+
checkpoint = "epinnock/wizardcoder1b-merged"
|
41 |
+
device = "cuda" # for GPU usage or "cpu" for CPU usage
|
42 |
+
|
43 |
+
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
44 |
+
model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
|
45 |
+
|
46 |
+
inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device)
|
47 |
+
outputs = model.generate(inputs)
|
48 |
+
print(tokenizer.decode(outputs[0]))
|
49 |
+
```
|
50 |
+
|
51 |
+
### Fill-in-the-middle
|
52 |
+
Fill-in-the-middle uses special tokens to identify the prefix/middle/suffix part of the input and output:
|
53 |
+
|
54 |
+
```python
|
55 |
+
input_text = "<fim_prefix>def print_hello_world():\n <fim_suffix>\n print('Hello world!')<fim_middle>"
|
56 |
+
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
|
57 |
+
outputs = model.generate(inputs)
|
58 |
+
print(tokenizer.decode(outputs[0]))
|
59 |
+
```
|
60 |
+
|
61 |
+
### Attribution & Other Requirements
|
62 |
+
|
63 |
+
The pretraining dataset of the model was filtered for permissive licenses only. Nevertheless, the model can generate source code verbatim from the dataset. The code's license might require attribution and/or other specific requirements that must be respected. We provide a [search index](https://huggingface.co/spaces/bigcode/starcoder-search) that let's you search through the pretraining data to identify where generated code came from and apply the proper attribution to your code.
|
64 |
+
|
65 |
+
# Limitations
|
66 |
+
|
67 |
+
The model has been trained on source code from 80+ programming languages. The predominant natural language in source code is English although other languages are also present. As such the model is capable of generating code snippets provided some context but the generated code is not guaranteed to work as intended. It can be inefficient, contain bugs or exploits. See [the paper](https://drive.google.com/file/d/1cN-b9GnWtHzQRoE7M7gAEyivY0kl4BYs/view) for an in-depth discussion of the model limitations.
|
68 |
+
|
69 |
+
# Training
|
70 |
+
|
71 |
+
|
72 |
+
starcoder/finetune/finetune.py
|
73 |
+
--model_path=bigcode/starcoderbase-1b
|
74 |
+
--dataset_name=nickrosh/Evol-Instruct-Code-80k-v1
|
75 |
+
--split=train
|
76 |
+
--size_valid_set 5000
|
77 |
+
--streaming
|
78 |
+
--seq_length 2048
|
79 |
+
--max_steps 2400
|
80 |
+
--batch_size 6
|
81 |
+
--input_column_name=instruction
|
82 |
+
--gradient_accumulation_steps 16
|
83 |
+
--learning_rate 1e-4
|
84 |
+
--lr_scheduler_type=cosine
|
85 |
+
--num_warmup_steps 100
|
86 |
+
--weight_decay 0.05
|
87 |
+
|
88 |
+
## Model
|
89 |
+
|
90 |
+
- **Architecture:** StarCoder GPT-2 model with multi-query attention and Fill-in-the-Middle objective with LoRA layers merged
|
91 |
+
- **Fintune steps:** 2400
|
92 |
+
- **Pretraining tokens:** 1 trillion
|
93 |
+
- **Precision:** bfloat16
|
94 |
+
|
95 |
+
## Hardware
|
96 |
+
|
97 |
+
- **GPUs:** 8 A5000
|
98 |
+
- **Training time:** 2 days
|
99 |
+
|
100 |
+
|
101 |
+
|
102 |
+
# License
|
103 |
+
The model is licensed under the BigCode OpenRAIL-M v1 license agreement. You can find the full agreement [here](https://huggingface.co/spaces/bigcode/bigcode-model-license-agreement).
|