Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/nyu-mll/ILF-for-code-generation
- Owner: nyu-mll
- License: mit
- Created: 2023-03-23T22:46:02.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-19T19:13:47.000Z (about 1 year ago)
- Last Synced: 2024-07-18T22:20:32.077Z (2 months ago)
- Language: Python
- Size: 760 KB
- Stars: 73
- Watchers: 6
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 PerezThis 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.