Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nyu-mll/ILF-for-code-generation


https://github.com/nyu-mll/ILF-for-code-generation

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# Improving Code Generation by Training with Natural Language Feedback
Authors: Angelica Chen, Jérémy Scheurer, Tomasz Korbak, Jon Ander Campos, Jun Shern Chan, Samuel R. Bowman, Kyunghyun Cho, Ethan Perez

This repository contains the code and data (human-written feedback and refinements) for running the Imitation learning from Language Feedback (ILF) algorithm
for code generation from "Improving Code Generation by Training with Natural Language Feedback" by [Chen et al. (2023)](https://arxiv.org/abs/2303.16749).



## Installation

Our code relies upon the [`jaxformer` repository](https://github.com/salesforce/jaxformer) and open-source [CodeGen-Mono checkpoints](https://github.com/salesforce/CodeGen).

To install all dependencies and download the necessary model checkpoints:
```{bash}
git clone [email protected]:nyu-mll/ILF-for-code-generation.git
cd ILF-for-code-generation
conda env create -f environment.yml

# Install codegen repo and reset to old commit
git clone [email protected]:salesforce/CodeGen.git
cd CodeGen
git reset --hard 9cc1f971c83ad606cce5da292d3c58523dd920a2
git clean -df
pip3 install -r requirements.txt
cd ..

# To download codegen-6B-mono
wget -P checkpoints https://storage.googleapis.com/sfr-codegen-research/checkpoints/codegen-6B-mono.tar.gz && tar -xvf checkpoints/codegen-6B-mono.tar.gz -C checkpoints/

```

In our paper we use the Codegen-Mono 6B checkpoint, but you can easily replace the above `wget` command with the download links for the [other CodeGen models](https://github.com/salesforce/CodeGen#sampling-with-repository).

## To run the ILF pipeline
To run the ILF pipeline using our dataset, run (from this directory):
```{bash}
source ilf_pipeline.sh -d $(pwd) -n
```
with `` replaced with the name of the subdirectory that you wish to store results in.