Salesforce / codet5p-16b

huggingface.co
Total runs: 355
24-hour runs: 0
7-day runs: 87
30-day runs: 301
Model's Last Updated: January 21 2025
text2text-generation

Introduction of codet5p-16b

Model Details of codet5p-16b

CodeT5+ 16B

Model description

CodeT5+ is a new family of open code large language models with an encoder-decoder architecture that can flexibly operate in different modes (i.e. encoder-only , decoder-only , and encoder-decoder ) to support a wide range of code understanding and generation tasks. It is introduced in the paper:

CodeT5+: Open Code Large Language Models for Code Understanding and Generation by Yue Wang *, Hung Le *, Akhilesh Deepak Gotmare , Nghi D.Q. Bui , Junnan Li , Steven C.H. Hoi (* indicates equal contribution).

Compared to the original CodeT5 family (base: 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 .

How to use

This model can be easily loaded using the AutoModelForSeq2SeqLM functionality and employs the same tokenizer as CodeGen .

from transformers import AutoModelForSeq2SeqLM, AutoTokenizer

checkpoint = "Salesforce/codet5p-16b"
device = "cuda" # for GPU usage or "cpu" for CPU usage

tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForSeq2SeqLM.from_pretrained(checkpoint,
                                              torch_dtype=torch.float16,
                                              low_cpu_mem_usage=True,
                                              trust_remote_code=True).to(device)

encoding = tokenizer("def print_hello_world():", return_tensors="pt").to(device)
encoding['decoder_input_ids'] = encoding['input_ids'].clone()
outputs = model.generate(**encoding, max_length=15)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Pretraining data

This checkpoint is trained on the stricter permissive subset of the deduplicated version of the github-code dataset . The data is preprocessed by reserving only permissively licensed code ("mit" “apache-2”, “bsd-3-clause”, “bsd-2-clause”, “cc0-1.0”, “unlicense”, “isc”). Supported languages (9 in total) are as follows: c , c++ , c-sharp , go , java , javascript , php , python , ruby.

Training procedure

This checkpoint is initialized from off-the-shelf LLMs, i.e. its encoder is initialized from CodeGen-350M-mono and its decoder is initialized from CodeGen-16B-mono . It is trained on the unimodal code data at the first-stage pretraining, which includes a diverse set of pretraining tasks including span denoising and two variants of causal language modeling . After that, it is further trained on the Python subset with the causal language modeling objective for another epoch to better adapt for Python code generation. Please refer to the paper for more details.

Evaluation results

CodeT5+ models have been comprehensively evaluated on a wide range of code understanding and generation tasks in various settings: zero-shot , finetuning , and instruction-tuning . Specifically, CodeT5+ yields substantial performance gains on many downstream tasks compared to their SoTA baselines, e.g., 8 text-to-code retrieval tasks (+3.2 avg. MRR), 2 line-level code completion tasks (+2.1 avg. Exact Match), and 2 retrieval-augmented code generation tasks (+5.8 avg. BLEU-4). In 2 math programming tasks on MathQA-Python and GSM8K-Python, CodeT5+ models of below billion-parameter sizes significantly outperform many LLMs of up to 137B parameters. Particularly, in the zero-shot text-to-code generation task on HumanEval benchmark, InstructCodeT5+ 16B sets new SoTA results of 35.0% pass@1 and 54.5% pass@10 against other open code LLMs, even surpassing the closed-source OpenAI code-cushman-001 mode Please refer to the paper for more details.

BibTeX entry and citation info
@article{wang2023codet5plus,
  title={CodeT5+: Open Code Large Language Models for Code Understanding and Generation},
  author={Wang, Yue and Le, Hung and Gotmare, Akhilesh Deepak and Bui, Nghi D.Q. and Li, Junnan and Hoi, Steven C. H.},
  journal={arXiv preprint},
  year={2023}
}

Runs of Salesforce codet5p-16b on huggingface.co

355
Total runs
0
24-hour runs
21
3-day runs
87
7-day runs
301
30-day runs

More Information About codet5p-16b huggingface.co Model

More codet5p-16b license Visit here:

https://choosealicense.com/licenses/bsd-3-clause

codet5p-16b huggingface.co

codet5p-16b huggingface.co is an AI model on huggingface.co that provides codet5p-16b's model effect (), which can be used instantly with this Salesforce codet5p-16b model. huggingface.co supports a free trial of the codet5p-16b model, and also provides paid use of the codet5p-16b. Support call codet5p-16b model through api, including Node.js, Python, http.

Salesforce codet5p-16b online free

codet5p-16b huggingface.co is an online trial and call api platform, which integrates codet5p-16b's modeling effects, including api services, and provides a free online trial of codet5p-16b, you can try codet5p-16b online for free by clicking the link below.

Salesforce codet5p-16b online free url in huggingface.co:

https://huggingface.co/Salesforce/codet5p-16b

codet5p-16b install

codet5p-16b is an open source model from GitHub that offers a free installation service, and any user can find codet5p-16b on GitHub to install. At the same time, huggingface.co provides the effect of codet5p-16b install, users can directly use codet5p-16b installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

codet5p-16b install url in huggingface.co:

https://huggingface.co/Salesforce/codet5p-16b

Url of codet5p-16b

Provider of codet5p-16b huggingface.co

Salesforce
ORGANIZATIONS

Other API from Salesforce

huggingface.co

Total runs: 37.7K
Run Growth: -16.9K
Growth Rate: -44.71%
Updated: January 21 2025
huggingface.co

Total runs: 8.7K
Run Growth: 1.8K
Growth Rate: 20.76%
Updated: February 19 2024
huggingface.co

Total runs: 2.8K
Run Growth: 907
Growth Rate: 27.16%
Updated: January 25 2025
huggingface.co

Total runs: 672
Run Growth: 605
Growth Rate: 90.03%
Updated: January 21 2025
huggingface.co

Total runs: 563
Run Growth: 224
Growth Rate: 39.79%
Updated: January 21 2025
huggingface.co

Total runs: 290
Run Growth: 1
Growth Rate: 0.34%
Updated: January 15 2025
huggingface.co

Total runs: 49
Run Growth: -56
Growth Rate: -114.29%
Updated: January 15 2025