from hf_hub_ctranslate2 import TranslatorCT2fromHfHub, GeneratorCT2fromHfHub
from transformers import AutoTokenizer
model_name = "michaelfeil/ct2fast-codegen2-1B"# use either TranslatorCT2fromHfHub or GeneratorCT2fromHfHub here, depending on model.
model = GeneratorCT2fromHfHub(
# load in int8 on CUDA
model_name_or_path=model_name,
device="cuda",
compute_type="int8_float16",
# tokenizer=AutoTokenizer.from_pretrained("Salesforce/codegen2-1B")
)
outputs = model.generate(
text=["def print_hello_world():", "def hello_name(name:"],
max_length=64
)
print(outputs)
Licence and other remarks:
This is just a quantized version. Licence conditions are intended to be idential to original huggingface repo.
Original description
tags:
ctranslate2
int8
float16
CodeGen2 (CodeGen2-1B)
Model description
CodeGen2
is a family of autoregressive language models for
program synthesis
, introduced in the paper:
You might want to truncate the model output with
<eom>
.
Training data
This checkpoint is trained on the stricter permissive subset of
the deduplicated version of the Stack dataset (v1.1)
. Supported languages (and frameworks) are as follows:
c
,
c++
,
c-sharp
,
dart
,
go
,
java
,
javascript
,
kotlin
,
lua
,
php
,
python
,
ruby
,
rust
,
scala
,
shell
,
sql
,
swift
,
typescript
,
vue
.
Training procedure
CodeGen2 was trained using cross-entropy loss to maximize the likelihood of sequential inputs.
The input sequences are formatted in two ways: (1) causal language modeling and (2) file-level span corruption.
Please refer to the paper for more details.
Evaluation results
We evaluate our models on HumanEval and HumanEval-Infill. Please refer to the
paper
for more details.
Intended use and limitations
As an autoregressive language model, CodeGen2 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.
BibTeX entry and citation info
@article{Nijkamp2023codegen2,
title={CodeGen2: Lessons for Training LLMs on Programming and Natural Languages},
author={Nijkamp, Erik and Hayashi, Hiroaki and Xiong, Caiming and Savarese, Silvio and Zhou, Yingbo},
journal={arXiv preprint},
year={2023}
}
Runs of michaelfeil ct2fast-codegen2-1B on huggingface.co
3
Total runs
0
24-hour runs
0
3-day runs
2
7-day runs
0
30-day runs
More Information About ct2fast-codegen2-1B huggingface.co Model
ct2fast-codegen2-1B huggingface.co is an AI model on huggingface.co that provides ct2fast-codegen2-1B's model effect (), which can be used instantly with this michaelfeil ct2fast-codegen2-1B model. huggingface.co supports a free trial of the ct2fast-codegen2-1B model, and also provides paid use of the ct2fast-codegen2-1B. Support call ct2fast-codegen2-1B model through api, including Node.js, Python, http.
ct2fast-codegen2-1B huggingface.co is an online trial and call api platform, which integrates ct2fast-codegen2-1B's modeling effects, including api services, and provides a free online trial of ct2fast-codegen2-1B, you can try ct2fast-codegen2-1B online for free by clicking the link below.
michaelfeil ct2fast-codegen2-1B online free url in huggingface.co:
ct2fast-codegen2-1B is an open source model from GitHub that offers a free installation service, and any user can find ct2fast-codegen2-1B on GitHub to install. At the same time, huggingface.co provides the effect of ct2fast-codegen2-1B install, users can directly use ct2fast-codegen2-1B installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
ct2fast-codegen2-1B install url in huggingface.co: