Views
No views yet
220M, large: 770M), CodeT5+ is pretrained with a diverse set of
pretraining tasks including span denoising, causal language modeling, contrastive learning, and text-code
matching to learn rich representations from both unimodal code data and bimodal code-text data.
Additionally, it employs a simple yet effective compute-efficient pretraining method to initialize the model
components with frozen off-the-shelf LLMs such as CodeGen to efficiently scale
up the model (i.e. 2B, 6B, 16B), and adopts a "shallow encoder and deep decoder" architecture.
Furthermore, it is instruction-tuned to align with natural language instructions (see our InstructCodeT5+ 16B)
following Code Alpaca.AutoModel functionality and employs the CodeT5 tokenizer with three special tokens added ([ENC], [TDEC], [CDEC]).
This checkpoint consists of a CodeT5+ 220M model and a projection layer and an itm_head layer for text-code matching.1from transformers import AutoModel, AutoTokenizer
2
3checkpoint = "Salesforce/codet5p-220m-bimodal"
4device = "cuda" # for GPU usage or "cpu" for CPU usage
5
6tokenizer = AutoTokenizer.from_pretrained(checkpoint, trust_remote_code=True)
7model = AutoModel.from_pretrained(checkpoint, trust_remote_code=True).to(device)c, c++, c-sharp, go, java, javascript, php, python, ruby.1@article{wang2023codet5plus,
2 title={CodeT5+: Open Code Large Language Models for Code Understanding and Generation},
3 author={Wang, Yue and Le, Hung and Gotmare, Akhilesh Deepak and Bui, Nghi D.Q. and Li, Junnan and Hoi, Steven C. H.},
4 journal={arXiv preprint},
5 year={2023}
6}