File size: 5,115 Bytes
f5eeebc
 
50ce5cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f5eeebc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50ce5cf
 
 
 
f5eeebc
 
 
 
0d03152
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f5eeebc
0d03152
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
---
dataset_info:
- config_name: annotated
  features:
  - name: messages
    list:
    - name: role
      dtype: string
    - name: content
      dtype: string
  - name: language
    dtype: string
  - name: prompt_type
    dtype: string
  - name: lint_errors
    dtype: int64
  - name: cyclomatic_complexity
    dtype: int64
  - name: license
    dtype: string
  - name: commit
    dtype: string
  - name: repos
    dtype: string
  - name: new_file
    dtype: string
  - name: status
    dtype: string
  - name: error
    dtype: string
  - name: is_valid_syntax
    dtype: bool
  splits:
  - name: train
    num_bytes: 338825015
    num_examples: 145058
  download_size: 291448763
  dataset_size: 338825015
- config_name: sft
  features:
  - name: messages
    list:
    - name: role
      dtype: string
    - name: content
      dtype: string
  - name: language
    dtype: string
  - name: prompt_type
    dtype: string
  - name: lint_errors
    dtype: int64
  - name: cyclomatic_complexity
    dtype: int64
  - name: license
    dtype: string
  - name: commit
    dtype: string
  - name: repos
    dtype: string
  - name: new_file
    dtype: string
  splits:
  - name: train
    num_bytes: 276611786
    num_examples: 122018
  download_size: 242436696
  dataset_size: 276611786
configs:
- config_name: annotated
  data_files:
  - split: train
    path: annotated/train-*
- config_name: sft
  data_files:
  - split: train
    path: sft/train-*
language:
- code
- en
license: other
source_datasets:
- bigcode/commitpackft
task_categories:
- text-generation
pretty_name: CodeAlign curated CommitPackFT
license_name: per-sample-permissive
tags:
- code
- sft
- commitpackft
- code-quality
---

# CodeAlign — curated CommitPackFT (8 languages)

Instruction/code pairs from [`bigcode/commitpackft`](https://huggingface.co/datasets/bigcode/commitpackft), filtered for syntax validity (tree-sitter), per-language lint errors, cyclomatic complexity, internal duplication and cross-sample near-duplicates (MinHash/LSH). Built as the SFT set of [CodeAlign](https://github.com/Sergasgr/codealign); the pipeline, thresholds and the full curation report live in that repository.

| config | rows | contents |
|---|---|---|
| `sft` (default) | 122,018 | accepted samples — the SFT training set minus the rows dropped for secrets (see Privacy) |
| `annotated` | 145,058 | every processed sample with its curation verdict (`status`, `error`) |

```python
from datasets import load_dataset
sft = load_dataset("Sergasgr/codealign-commitpackft", "sft", split="train")
```

## Format

`messages` is ChatML (`user` prompt, `assistant` target file). Two prompt types, derived from the commit itself: `new_file` (write-from-spec; commit created the file) and `edit` (existing file + commit message as instruction). 84.6% of `sft` rows are `edit`.

## Languages (`sft`)

| language | rows |
|---|---|
| javascript | 45,084 |
| python | 39,725 |
| java | 15,779 |
| c_sharp | 8,062 |
| typescript | 4,339 |
| cpp | 3,668 |
| go | 3,034 |
| rust | 2,327 |

## Licensing and provenance

Only samples whose upstream `license` is one of apache-2.0, bsd-2-clause, bsd-3-clause, cc0-1.0, isc, mit, unlicense are included; the licence of every sample is in its `license` column and applies to that sample's code.

| license | `sft` rows |
|---|---|
| mit | 76,499 |
| apache-2.0 | 26,849 |
| bsd-3-clause | 11,913 |
| bsd-2-clause | 3,887 |
| isc | 1,423 |
| unlicense | 985 |
| cc0-1.0 | 462 |

As in CommitPackFT, each row keeps its source `commit` and `repos` so the copyright holder can be identified (100.0% of `sft` rows carry provenance). Code authors who want their code removed can open an issue on the GitHub repository.

## Known issues in the quality columns

`lint_errors` holds the values computed by the v1.0 curation run, which had linter bugs (the data was not re-curated):
- **C++, JavaScript, TypeScript:** `lint_errors` is always 0, so these languages were filtered on syntax, complexity and duplication only. cpplint's total was parsed from the wrong output stream (fixed in the repository afterwards); ESLint ≥ 9 rejects the `--no-eslintrc` command line (still open).
- **Python:** every value includes ruff's summary line (+1, or +2 when ruff also printed a fix hint), so the actual number of violations is 1–2 lower (fixed in the repository afterwards).

## Privacy

- Rows containing a high-confidence secret (private key blocks, AWS / GitHub / Slack / Google / Stripe credentials) were dropped: 48 from `sft`, 56 from `annotated`.
- E-mail addresses (other than documentation and GitHub no-reply domains) were replaced with `<EMAIL>` in 8,272 `sft` rows.
- Detection is pattern-based and will miss some personal data; do not use this dataset to identify individuals.

## Decontamination

13-gram overlap of every HumanEval and MBPP problem (prompt + canonical solution) against the Python samples is reported in `src/notebooks/01_curation_report.ipynb` of the GitHub repository.

## Citation

Upstream data: Muennighoff et al., *OctoPack: Instruction Tuning Code Large Language Models* (2023), arXiv:2308.07124.