Model reference · open weights
codegen-mono is an open-weight language model from Salesforce, listed in the AxForge catalogue. AxForge can bring it up on EU-owned hardware for you on request — with the licence handled where one is required.
About
CodeGen (CodeGen-Mono 350M) Model description CodeGen is a family of autoregressive language models for program synthesis from the paper: A Conversational Paradigm for Program Synthesis by Erik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu, Huan Wang, Yingbo Zhou, Silvio Savarese, Caiming Xiong. The models are originally released in this repository, under 3 pre-training data variants (NL, Multi, Mono) and 4 model size variants (350M, 2B, 6B, 16B). The checkpoint included in this repository is denoted as CodeGen-Mono 350M in the paper, where "Mono" means the model is initialized with CodeGen-Multi 350M and further pre-trained on a Python programming language dataset, and "350M" refers to the number of trainable parameters. Training data This checkpoint (CodeGen-Mono 350M) was firstly initialized with CodeGen-Multi 350M, and then pre-trained on BigPython dataset. The data consists of 71.7B tokens of Python programming language. See Section 2.1 of the paper for more details. Training procedure CodeGen was trained using cross-entropy loss to maximize the likelihood of sequential inputs. The family of models are trained using multiple TPU-v4-512 by Google, leveraging data and model parallelism. See Section 2.3 of the paper for more details. Evaluation results We evaluate our models on two code generation benchmark: HumanEval and MTPB. Please refer to the paper for more details. Intended Use and Limitations As an autoregressive language model, CodeGen is capable of extracting features from given natural language and programming language texts, and calculating the likelihood of them. However, the model is intended for and best at program synthesis, that is, generating executable code given English prompts, where the prompts should be in the form of a comment string. The model can complete partially-generated code as well. How to use This model can be easily loaded using the AutoModelForCausalLM functionality: Ethical Considerations This release is for research purposes only in support of an academic paper. Our models, datasets, and code are not specifically designed or evaluated for all downstream purposes. We strongly recommend users evaluate and address potential concer
Summarised from the published model card. Read the full card on the HuggingFace links below.
Specifications
| Maker | Salesforce |
|---|---|
| Type | Language models |
| Context | 2k tokens |
| Variants | 1 |
| Runs with | transformers |
| Released | 2022-04-11 |
| Popularity | 127k downloads / month |
| Likes | 101 |
| Licence | Open weights |
How it works
Variants
Open weights ship in several sizes and precisions. One page, all the variants — pick the one that fits your GPU. VRAM figures are estimates from model size.
| Variant | Params | Precision | VRAM | Fits 16 GB | Weights |
|---|---|---|---|---|---|
| codegen-350M-mono | — | BF16 | — | — | Weights ↗ |
Using it via the API
Once AxForge deploys codegen-mono for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (codegen-mono below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/chat/completions \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"codegen-mono","messages":[{"role":"user","content":"Hello"}]}'
Licence
Open weights under bsd-3-clause — commercial use is permitted. Deploy it on AxForge EU hardware on request. Read the licence ↗