SuperAPIAI Directory

CodeGen2.5-7B-multi

huggingface.co · AI coding

CodeGen2.5-7B-multi is an autoregressive language model released by Salesforce for program synthesis, trained on 1.4T tokens from StarCoderData, supporting multiple programming languages and code infilling. The model is released under the Apache-2.0 license and can be loaded via Hugging Face Transformers' AutoModelForCausalLM; OpenAI tiktoken must be installed as the tokenizer.

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

About this tool

CodeGen2.5-7B-multi is one of the CodeGen2.5 series of autoregressive language models introduced by Salesforce, designed specifically for program synthesis. Building on CodeGen2, this model was trained on 1.4T tokens from StarCoderData and achieves competitive results with less than half the parameters of StarCoderBase-15.5B. The model supports code infilling and multiple programming languages.

Key capabilities:

  • Generate executable code from natural language comments;
  • Complete partially generated code (causal sampling);
  • Support infill sampling, using special tokens such as <mask_N>, <sep>, and <eom> to generate code at specified positions;
  • Extract features from natural language and programming language text and compute likelihoods.

Usage: The model can be loaded via Hugging Face Transformers' AutoModelForCausalLM functionality, and the tokenizer requires installing OpenAI tiktoken. For causal sampling, completions are generated directly from context; for infill sampling, the input is constructed in the CodeGen2 format: insert <mask_1> at the cursor position, append <sep> to indicate the boundary, then insert another <mask_1> to indicate the mask to be filled, and the output can be truncated with <eom>.

Applicable scenarios: Suitable for program synthesis tasks such as automatic code completion, generating code from English comments, and code infilling. The model was evaluated on HumanEval and HumanEval-Infill.

Limitations and notes:

  • The model is primarily intended for research purposes and was released to support academic papers; it has not been specifically designed or evaluated for all downstream uses;
  • Although the pretraining dataset was filtered for permissive licenses, the model may still verbatim reproduce source code from the dataset, and the relevant code licenses may require attribution or other specific conditions; the data provider BigCode provides a search index to trace the source of generated code;
  • Users must independently assess potential issues such as accuracy, safety, and fairness, and comply with applicable laws and acceptable use policies.

This repository is CodeGen2.5-7B-multi, released under the Apache-2.0 license. The same series also includes CodeGen2.5-7B-mono (with additional Python training, Apache-2.0) and CodeGen2.5-7B-instruct (trained on instruction data, for research purposes only).

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools