EditCoder-6.7b (version 1) is a fine-tuned version of [DeepSeek Coder](deepseek-ai/deepseek-coder-6.7b-base) (base model, 6.7b parameters) for instructional code editing.
We utilize [EditPackFT](https://huggingface.co/datasets/nuprl/EditPackFT) as our fine-tuning dataset, and we show state-of-the-art performance among non-distilled open source models
for code editing, using the [CanItEdit](https://huggingface.co/datasets/nuprl/CanItEdit) benchmark.

More information can be found on [our paper](https://federico.codes/assets/papers/canitedit.pdf).

# Prompt
The model has been trained on the following prompt format:
```
## Code Before:
{before}
## Instruction:
{instruction}
## Code After:
{after}
```

Here is a python function that can be used for formatting the prompt correctly:
```py
def edit_prompt(old, instr):
    before = f"""## Code Before:\n{old}\n"""
    instr = f"""## Instruction:\n{instr}\n"""
    after = f"""## Code After:\n"""
    return before + instr + after
```

# Train Your Own EditCoder
We provide the full pipeline that was used for training our own edit-coder model.
The pipeline and instructions can be found on our [GitHub repository](https://github.com/nuprl/CanItEdit/tree/main/editcoder).
{"language": ["code"], "library_name": "transformers", "tags": ["code"], "datasets": ["nuprl/EditPackFT"], "pipeline_tag": "text2text-generation", "model-index": [{"name": "EditCoder-6.7b-v1", "results": [{"task": {"type": "text-generation"}, "dataset": {"name": "CanItEdit Descriptive", "type": "nuprl/CanItEdit"}, "metrics": [{"type": "pass@1", "value": 0.4815, "name": "pass@1", "verified": false}, {"type": "pass@1", "value": 0.3696, "name": "pass@1", "verified": false}]}]}]}
transformers safetensors llama text-generation code text2text-generation dataset:nuprl/EditPackFT model-index autotrain_compatible endpoints_compatible text-generation-inference region:us