SuperAPIAI Directory

CodeT5+

github.com · AI coding

CodeT5+ is a family of open-source code large language models released by Salesforce, including various parameter sizes such as 220M, 770M, 2B, 6B, and 16B. It adopts an encoder-decoder architecture and can flexibly run in encoder-only, decoder-only, or encoder-decoder modes, supporting code understanding and generation tasks. The models learn from unimodal code data and bimodal code-text data through multi-task pretraining (span denoising, causal language modeling, contrastive learning, text-code matching), and are efficiently initialized using frozen off-the-shelf LLMs (such as CodeGen). In addition, an instruction-tuned version InstructCodeT5+ 16B (for research non-commercial use only) is provided, along with a 110M embedding model and a 220M bimodal model for tasks such as code retrieval and summarization. All models are available on Hugging Face and support loading via AutoModelForSeq2SeqLM and AutoTokenizer.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

CodeT5+ is a family of open code large language models released by the Salesforce research team, designed to support a wide range of code understanding and generation tasks. The model parameter sizes range from 220M to 16B, adopting an encoder-decoder architecture that can flexibly switch between encoder-only, decoder-only, or encoder-decoder modes.

Main capabilities:

  • Code generation: Supports text-to-code generation, with strong performance on the HumanEval benchmark in zero-shot settings.
  • Code understanding: Includes tasks such as code summarization and code retrieval.
  • Multi-task pretraining: Learns rich representations from unimodal code data and bimodal code-text data through tasks such as span denoising, causal language modeling, contrastive learning, and text-code matching.
  • Efficient scaling: Proposes a compute-efficient pretraining method that initializes models using frozen off-the-shelf LLMs (such as CodeGen).
  • Instruction tuning: Follows the Code Alpaca method for instruction tuning, releasing InstructCodeT5+ 16B (for research non-commercial use only).

Usage:

  • All models and tokenizers can be loaded via Hugging Face's AutoModelForSeq2SeqLM and AutoTokenizer.
  • For the 2B, 6B, 16B, and InstructCodeT5+ 16B models, trust_remote_code=True must be set when loading, and it is recommended to pass additional prompts to the decoder via decoder_input_ids to improve generation quality.
  • A fine-tuning script tune_codet5p_seq2seq.py is provided, supporting fine-tuning on custom data, with --load to select the model, adjustment of hyperparameters such as --epochs and --lr, support for single-GPU and multi-GPU training, mixed precision via --fp16, and DeepSpeed optimization via --deepspeed.
  • Reproduction scripts for HumanEval evaluation and text-to-code retrieval are provided.

Applicable scenarios:

  • Academic research and experiments related to code intelligence.
  • Fine-tuning and evaluation for downstream tasks such as code generation, code summarization, and code retrieval.
  • Scenarios requiring an open-source code large model for secondary development.

Limitations:

  • The InstructCodeT5+ 16B checkpoint is for research and non-commercial use only.
  • Some models (2B, 6B, 16B) require setting trust_remote_code=True to load.
  • Reproduction results may differ slightly due to sampling randomness.
  • No specific pricing, cost, or commercial licensing information is provided.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools