Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
inference: false
|
| 3 |
+
datasets:
|
| 4 |
+
- bigcode/commitpackft
|
| 5 |
+
model-index:
|
| 6 |
+
- name: patched-coder-34b
|
| 7 |
+
results:
|
| 8 |
+
- task:
|
| 9 |
+
type: text-generation
|
| 10 |
+
dataset:
|
| 11 |
+
type: openai_humaneval
|
| 12 |
+
name: HumanEval
|
| 13 |
+
metrics:
|
| 14 |
+
- name: pass@1
|
| 15 |
+
type: pass@1
|
| 16 |
+
value: 53.567
|
| 17 |
+
verified: false
|
| 18 |
+
- task:
|
| 19 |
+
type: text-generation
|
| 20 |
+
dataset:
|
| 21 |
+
type: bigcode/humanevalpack
|
| 22 |
+
name: HumanEvalFix Python
|
| 23 |
+
metrics:
|
| 24 |
+
- name: pass@1
|
| 25 |
+
type: pass@1
|
| 26 |
+
value: 41.341
|
| 27 |
+
verified: false
|
| 28 |
+
- task:
|
| 29 |
+
type: text-generation
|
| 30 |
+
dataset:
|
| 31 |
+
type: patched-codes/static-analysis-eval
|
| 32 |
+
name: Static Analysis Eval
|
| 33 |
+
metrics:
|
| 34 |
+
- name: pass@1
|
| 35 |
+
type: pass@1
|
| 36 |
+
value: 51.316
|
| 37 |
+
verified: false
|
| 38 |
+
---
|
| 39 |
+
# Model Card for patched-coder-34b
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
This is an instruction fine-tuned model focussed on the task of patching code. Patching may include fixing bugs, remediating security vulnerabilities,
|
| 43 |
+
doing API migrations and other kinds of code matainence.
|
| 44 |
+
|
| 45 |
+
## Model Details
|
| 46 |
+
|
| 47 |
+
### Model Description
|
| 48 |
+
|
| 49 |
+
- **Developed by:** [codelion](https://huggingface.co/codelion)
|
| 50 |
+
- **Model type:** Code Llama
|
| 51 |
+
- **Finetuned from model:** [CodeLlama-34b-Python](https://huggingface.co/codellama/CodeLlama-34b-Python-hf)
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
## How to Get Started with the Model
|
| 55 |
+
|
| 56 |
+
Make sure to install Transformers from the main git branch:
|
| 57 |
+
|
| 58 |
+
```bash
|
| 59 |
+
pip install git+https://github.com/huggingface/transformers.git
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
## How to Prompt the Model
|
| 63 |
+
|
| 64 |
+
This model accepts the alpaca instruction format.
|
| 65 |
+
|
| 66 |
+
For example:
|
| 67 |
+
|
| 68 |
+
```
|
| 69 |
+
### Instruction:
|
| 70 |
+
{instruction}
|
| 71 |
+
|
| 72 |
+
### Input:
|
| 73 |
+
{input}
|
| 74 |
+
|
| 75 |
+
### Response:
|
| 76 |
+
...
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
## Bias, Risks, and Limitations
|
| 80 |
+
|
| 81 |
+
This model has undergone very limited testing. Additional safety testing should be performed before any real-world deployments.
|
| 82 |
+
|
| 83 |
+
## Training Details
|
| 84 |
+
|
| 85 |
+
- **GPU:** A100 80 GB
|
| 86 |
+
- **Time:** ~8 hrs
|
| 87 |
+
|
| 88 |
+
### Training Data
|
| 89 |
+
|
| 90 |
+
The model was fine-tuned on [commitpackft](https://huggingface.co/datasets/bigcode/commitpackft), an open dataset consisting of commits.
|
| 91 |
+
We started with the commits for the `python` langauge from the dataset and then filtered all the commits that were related to fixing bugs.
|
| 92 |
+
|
| 93 |
+
### Training Procedure
|
| 94 |
+
|
| 95 |
+
Instruction fine-tuning to follow instructions in natural langauge related to code. We load the quantized base model in 4 bits
|
| 96 |
+
and then use QLoRA for Parameter-Efficient Fine-Tuning (PEFT) with Flash Attention. The model was trained for 2 epochs.
|
| 97 |
+
|
| 98 |
+
#### Training Hyperparameters
|
| 99 |
+
|
| 100 |
+
**Training regime:**
|
| 101 |
+
|
| 102 |
+
The following `bitsandbytes` quantization config was used during training:
|
| 103 |
+
- quant_method: bitsandbytes
|
| 104 |
+
- load_in_8bit: False
|
| 105 |
+
- load_in_4bit: True
|
| 106 |
+
- llm_int8_threshold: 6.0
|
| 107 |
+
- llm_int8_skip_modules: None
|
| 108 |
+
- llm_int8_enable_fp32_cpu_offload: False
|
| 109 |
+
- llm_int8_has_fp16_weight: False
|
| 110 |
+
- bnb_4bit_quant_type: nf4
|
| 111 |
+
- bnb_4bit_use_double_quant: True
|
| 112 |
+
- bnb_4bit_compute_dtype: bfloat16
|
| 113 |
+
|
| 114 |
+
## Evaluation
|
| 115 |
+
|
| 116 |
+
We evaluate the model on `HumanEval` and `HumanEvalPack` benchmarks using
|
| 117 |
+
[Code Generation LM Evaluation Harness](https://github.com/bigcode-project/bigcode-evaluation-harness).
|
| 118 |
+
|
| 119 |
+
We also evaluate the model for vulnerability remediation using the `Static Analysis Eval` benchmark available [here](https://huggingface.co/datasets/patched-codes/static-analysis-eval).
|
| 120 |
+
|
| 121 |
+
### Results
|