pedrovhb's picture
Update readme to fix typo in model ID
b5fb0f9
|
raw
history blame
No virus
3.68 kB
---
license: bigcode-openrail-m
datasets:
- nickrosh/Evol-Instruct-Code-80k-v1
language:
- en
---
# epinnock/WizardCoder-1B-merged
## Table of Contents
1. [Model Summary](##model-summary)
2. [Use](##use)
3. [Limitations](##limitations)
4. [Training](##training)
5. [License](##license)
## Model Summary
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.
Based on Previous works of @WizardLM
- **Training Report:** [wandb](https://wandb.ai/aetherfoundry/huggingface/reports/Training-Report--Vmlldzo1MDUwOTcx)
- **Repository:** [bigcode/Starcoder](https://github.com/bigcode-project/starcoder)
- **Project Website:** [bigcode-project.org](https://www.bigcode-project.org)
## Use
### Generation
```python
# pip install -q transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "epinnock/wizardcoder-1b-merged"
device = "cuda" # for GPU usage or "cpu" for CPU usage
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device)
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))
```
### Fill-in-the-middle
Fill-in-the-middle uses special tokens to identify the prefix/middle/suffix part of the input and output:
```python
input_text = "<fim_prefix>def print_hello_world():\n <fim_suffix>\n print('Hello world!')<fim_middle>"
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))
```
### Attribution & Other Requirements
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.
# Limitations
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.
# Training
starcoder/finetune/finetune.py
--model_path=bigcode/starcoderbase-1b
--dataset_name=nickrosh/Evol-Instruct-Code-80k-v1
--split=train
--size_valid_set 5000
--streaming
--seq_length 2048
--max_steps 2400
--batch_size 6
--input_column_name=instruction
--gradient_accumulation_steps 16
--learning_rate 1e-4
--lr_scheduler_type=cosine
--num_warmup_steps 100
--weight_decay 0.05
## Model
- **Architecture:** StarCoder GPT-2 model with multi-query attention and Fill-in-the-Middle objective with LoRA layers merged
- **Fintune steps:** 2400
- **Pretraining tokens:** 1 trillion
- **Precision:** bfloat16
## Hardware
- **GPUs:** 8 A5000
- **Training time:** 2 days
# License
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).