DeciCoder 1B is a 1 billion parameter decoder-only code completion model
trained on the Python, Java, and Javascript subsets of
Starcoder Training Dataset.
The model uses Grouped Query Attention and has a context window of 2048
tokens. It was trained using a Fill-in-the-Middle training objective. The model's
architecture was generated by Deci's proprietary Neural Architecture
Search-based technology, AutoNAC.
The model is intended to do single/multiline code completion from a
context window of up to 2048k tokens. It is not an instruction model
and commands like "Write a function that computes the absolute value of
an integer," won't yield the desired results. A more effective approach
is to frame instructions in the style of source code comments (e.g. #
this function calculates the absolute value of an integer) or to present
a function signature and docstring, enabling the model to complete the
function's body.
1# pip install -q transformers
2import torch
3from transformers import AutoModelForCausalLM, AutoTokenizer
4
5checkpoint = "Deci/DeciCoder-1b"
6device = "cuda" # for GPU usage or "cpu" for CPU usage
7
8tokenizer = AutoTokenizer.from_pretrained(checkpoint)
9model = AutoModelForCausalLM.from_pretrained(checkpoint, torch_dtype=torch.bfloat16, trust_remote_code=True).to(device)
10
11inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device)
12outputs = model.generate(inputs, max_new_tokens=100)
13print(tokenizer.decode(outputs[0]))
DeciCoder was trained on StarCoder Training Dataset, filtered for
Python, Java, and Javascript code. For additional information, please
refer to
https://huggingface.co/datasets/bigcode/starcoderdata.
The model has undergone training with source code from Python, Java, and
JavaScript. While the primary language in the source is English, it does
contain other languages. Therefore, the model can produce code snippets
given some context. However, there's no assurance that the resulting
code will function as expected. It might be suboptimal, contain bugs, or
even exploits.
DeciCoder was trained on the Python, Java, and Javascript subsets of
Starcoder Training Dataset
Please cite this model using this format.
1@misc{DeciFoundationModels,
2title = {DeciCoder},
3author = {DeciAI Research Team},
4year = {2023}
5url={[https://huggingface.co/deci/decicoder-1b](https://huggingface.co/deci/decicoder-1b)},
6}