Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Initial readme
  • Loading branch information
enijkamp authored Mar 13, 2023
1 parent d9e1a7e commit d303e95
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
# CodeGen2
# CodeGen2

Official research release for the **CodeGen2** models (`3B`, `7B`, `16B`) for **Program Synthesis** as presented in ICLR 2023:

*Title*: [CodeGen2: Lessons for Training LLMs on Programming and Natural Languages](https://arxiv.org/abs/TBD)

*Authors*: [Erik Nijkamp](https://enijkamp.github.io/)\*, [Hiroaki Hayashi](https://hiroakih.me/)\*, [Silvio Savarese](https://scholar.google.com/citations?user=ImpbxLsAAAAJ&hl=en), [Caiming Xiong](https://scholar.google.com/citations?user=vaSdahkAAAAJ&hl=en), and [Yingbo Zhou](https://scholar.google.com/citations?user=H_6RQ7oAAAAJ&hl=en) (* indicates equal contribution)

## Sampling

Program synthesis in the form of auto-regressive sampling can be performed as follows:

```python
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained()
model = AutoModelForCausalLM.from_pretrained()
inputs = tokenizer("# this function prints hello world", return_tensors="pt").to(0)
sample = model.generate(**inputs, max_length=128)
print(tokenizer.decode(sample[0], truncate_before_pattern=[r"\n\n^#", "^'''", "\n\n\n"]))
```

0 comments on commit d303e95

Please sign in to comment.