epinnock/WizardCoder-1B-merged

Table of Contents

  1. Model Summary
  2. Use
  3. Limitations
  4. Training
  5. License

Model Summary

1B version of StarCoderBase. LoRa finetuned on Evol-Instruct-Code-80k-v1 dataset generated using the Evol-Teacher repo. Based on Previous works of @WizardLM

Use

Generation

# 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:

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 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 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.

Downloads last month
21
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Dataset used to train epinnock/wizardcoder-1b-merged