Datasets:
File size: 17,916 Bytes
d9a8780 71312a6 d9a8780 a79c7cc d9a8780 a79c7cc d9a8780 a79c7cc d9a8780 a79c7cc d9a8780 a79c7cc d9a8780 a79c7cc d9a8780 a79c7cc d9a8780 a79c7cc d9a8780 a79c7cc d9a8780 a79c7cc 1741c42 a79c7cc 1741c42 a79c7cc d2b55b5 a79c7cc d2b55b5 a79c7cc | 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 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | ---
pretty_name: Korean Pretraining Corpus — github_code_v1
license: other
license_name: upstream-source-specific-conditions
license_link: https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/LICENSE-SCOPE.md
configs:
- config_name: original_documents
default: true
data_files:
- split: all
path: text/*.parquet
tags:
- pretraining
- reproducibility
- text
- llm
- language-modeling
- korean-pretrain-corpus
- tokenized
- exact-deduplication
- canonical-splits
- code
- source-code
task_categories:
- text-generation
---
# korean-pretrain-code
[한국어](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/cards/README.ko.md) · [English](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/cards/README.en.md) · [简体中文](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/cards/README.zh-CN.md) · [繁體中文](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/cards/README.zh-TW.md) · [日本語](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/cards/README.ja.md) · [Français](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/cards/README.fr.md) · [Deutsch](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/cards/README.de.md) · [Español](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/cards/README.es.md) · [Português (Brasil)](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/cards/README.pt-BR.md) · [हिन्दी](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/cards/README.hi.md) · [العربية](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/cards/README.ar.md) · [עברית](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/cards/README.he.md) · [Русский](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/cards/README.ru.md)
## 한국어
### 개요
이 저장소는 아래에 표시한 한 소스의 정제·분리 자료를 제공합니다. 동일 소스의 전체 파일은 통합 corpus의 해당 폴더에서도 받을 수 있습니다. 데이터의 고정 버전과 문서의 갱신 버전은 구분합니다.
문서 번역 언어는 학습 데이터에 그 언어가 포함된다는 뜻이 아닙니다. 주 자연언어는 한국어·영어이며 웹·수학·코드에 다른 언어가 섞일 수 있습니다.
### 구성과 규모
| | |
|---|---:|
| 소스 | github_code_v1 |
| 문서 수 | 2,148,459 |
| train 문서 | 2,125,938 |
| eval 문서 | 22,521 |
| 텍스트 bytes | 3,584,084,955 |
| | |
|---|---:|
| tokens | 4,006,737,196 |
| eval tokens | 42,420,481 |
| revision | v1.0.0 |
| upstream | [codeparrot/github-code](https://huggingface.co/datasets/codeparrot/github-code/blob/b5661e6b17396364b2bcf8e68977b0d28e1ebd19/README.md) |
| upstream license | other |
| provenance_status | `repo_path_row_preserved_git_commit_unknown` |
### 처리와 분리
웹은 공백 정리, 길이·반복·언어 휴리스틱, 일부 개인정보 패턴 마스킹을 거칩니다. 초기 샤드 내부 hash와 최종 웹 NFC SHA256의 기준은 다릅니다. 코드 정제는 대소문자·들여쓰기·원문 Unicode를 보존하고 경로·라이선스 표기·생성 코드·일부 비밀정보 패턴을 검사합니다. 동일 본문·웹 NFC 동등 본문·코드 저장소의 연결 그룹을 train/eval로 분리합니다.
### 사용법
아래 명령은 저장소 루트에서 실행합니다. 새 출력/다운로드 디렉터리를 사용하고 다운로드 전에 범위·용량·고정 revision을 확인하세요. 합성 CPU 예제는 외부 데이터를 받지 않습니다. 실제 데이터는 별도 배포에서 필요한 파일만 선택하고 CHECKSUMS.json 또는 소스별 manifest의 크기·SHA256을 검증하세요.
```bash
python -m pip install "pyarrow>=19,<20" "huggingface_hub>=0.34,<1" "tokenizers>=0.21,<0.23" "transformers==4.55.2" "requests>=2,<3"
```
```python
from huggingface_hub import snapshot_download
root = snapshot_download('pathcosmos/korean-pretrain-code', repo_type="dataset",
revision='v1.0.0', allow_patterns=['text/*.parquet', 'source.json', 'manifest.json', 'release.json', 'LICENSE-SCOPE.md'],
local_dir='korean-pretrain-code', token=False)
```
```python
from pathlib import Path
import subprocess, sys
from huggingface_hub import snapshot_download
reader = snapshot_download("pathcosmos/korean-pretrain-corpus", repo_type="dataset", revision="v1.1.0",
allow_patterns=["examples/*"], local_dir="corpus-reader", token=False)
subprocess.run([sys.executable, str(Path(reader) / "examples/stream_documents.py"),
"--repo", "pathcosmos/korean-pretrain-corpus", "--revision", "v1.1.0", "--source", "github_code_v1",
"--split", "train", "--limit", "10"], check=True)
```
[examples/stream_documents.py](https://huggingface.co/datasets/pathcosmos/korean-pretrain-corpus/blob/main/examples/stream_documents.py) · [manifest.json](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/manifest.json)
### 모델과 학습
모델은 RMSNorm·RoPE·GQA·SwiGLU를 사용하는 순수 PyTorch Dense decoder입니다. 실제 3B 경로는 FSDP2·8GPU·eager이며 문맥4096, micro batch4, global batch2,097,152 tokens, peak LR3e-4, 목표57,000step입니다. 예제의 CPU micro 모델과 실제 분산 학습 경로는 다릅니다. 체크포인트 재개에는 모델·optimizer·RNG·입력/설정 계약 검증이 필요합니다.
### 최적화·벤치마크
worker·thread·batch·SQLite 캐시·RAM·로컬/NFS와 eager/compile·정밀도·GPU 메모리를 비교했습니다. 총시간·처리량·peak 메모리·내용/수치 동등성을 함께 확인하고 채택·기각 이유를 기록합니다. 47개 캠페인·99개 결과 JSON을 제공하며 빠르더라도 수치 조건에 실패한 후보를 권장하지 않습니다. 짧은 표본의 최적값을 전체 최적값으로 주장하지 않습니다.
### 검증
GH 소스 공개판의 독립 CPU 검사는284통과/9건너뜀, 새 GitHub CPU 환경은258통과/35건너뜀입니다. 건너뜀은 원래 운영 기록 또는 별도 파일시스템이 필요한 검사입니다. 합성 quickstart는120문서·train100/eval20·vocab272·108,864parameter 모델로 저장/재개 후 model과optimizer 일치를 확인합니다. 데이터 배포의 내용 해시·분할/reader 검사와 전체3B 독립 재현은 구분합니다.
[release.json](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/release.json) · [source.json](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/source.json)
### 출처와 라이선스
프로젝트 원본 코드는 MIT, 원본 설명문은 CC BY4.0입니다. 이는 원문 데이터의 권리를 대신하지 않습니다. 소스별 라이선스·귀속·고지·알려진 미확정 항목은 source.json, LICENSE-SCOPE.md와 출처 문서를 확인하세요. 모든 원문에 대한 무조건적 상업 재배포 허가를 주장하지 않습니다.
[codeparrot/github-code](https://huggingface.co/datasets/codeparrot/github-code/blob/b5661e6b17396364b2bcf8e68977b0d28e1ebd19/README.md) · [source.json](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/source.json) · [LICENSE-SCOPE.md](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/LICENSE-SCOPE.md)
### 한계
전역 유사중복 제거·개인정보/secret 완전 제거·공식 평가 오염 없음·최종 모델 품질을 보장하지 않습니다. 공개 시점의 본학습은 진행 중이며 SFT·모델 export·공식 언어능력 benchmark 완료를 뜻하지 않습니다. 과거 실험11개 코드 참조/고유9hash는 원본 snapshot을 회수하지 못했습니다. 일부 운영 도구는 별도 원래 실행 manifest가 필요합니다.
### 관련 저장소
[GitHub](https://github.com/pathcosmos/korean-dense-llm/blob/main/cards/README.ko.md) · [README](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code)
[GH / 사용법](https://github.com/pathcosmos/korean-dense-llm/blob/main/docs/PUBLIC_GUIDE.md) · [GH / 최적화·벤치마크](https://github.com/pathcosmos/korean-dense-llm/blob/main/experiments/README.md) · [GH / 검증](https://github.com/pathcosmos/korean-dense-llm/blob/main/docs/PUBLIC_VALIDATION.md)
- [korean-pretrain-corpus](https://huggingface.co/datasets/pathcosmos/korean-pretrain-corpus/blob/main/cards/README.ko.md)
- [korean-pretrain-training-data](https://huggingface.co/datasets/pathcosmos/korean-pretrain-training-data/blob/main/cards/README.ko.md)
- [korean-pretrain-wikipedia](https://huggingface.co/datasets/pathcosmos/korean-pretrain-wikipedia/blob/main/cards/README.ko.md)
- [korean-pretrain-fineweb2](https://huggingface.co/datasets/pathcosmos/korean-pretrain-fineweb2/blob/main/cards/README.ko.md)
- [korean-pretrain-hplt2](https://huggingface.co/datasets/pathcosmos/korean-pretrain-hplt2/blob/main/cards/README.ko.md)
- [korean-pretrain-fineweb-edu](https://huggingface.co/datasets/pathcosmos/korean-pretrain-fineweb-edu/blob/main/cards/README.ko.md)
- [korean-pretrain-math](https://huggingface.co/datasets/pathcosmos/korean-pretrain-math/blob/main/cards/README.ko.md)
- [korean-pretrain-code](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/cards/README.ko.md)
- [wiki_ko/](https://huggingface.co/datasets/pathcosmos/korean-pretrain-corpus/tree/main/wiki_ko)
- [fineweb2_ko/](https://huggingface.co/datasets/pathcosmos/korean-pretrain-corpus/tree/main/fineweb2_ko)
- [hplt_ko/](https://huggingface.co/datasets/pathcosmos/korean-pretrain-corpus/tree/main/hplt_ko)
- [fineweb_edu/](https://huggingface.co/datasets/pathcosmos/korean-pretrain-corpus/tree/main/fineweb_edu)
- [owm/](https://huggingface.co/datasets/pathcosmos/korean-pretrain-corpus/tree/main/owm)
- [github_code_v1/](https://huggingface.co/datasets/pathcosmos/korean-pretrain-corpus/tree/main/github_code_v1)
## English
### Overview
This repository provides the cleaned, split material for the single source identified below. The same source files are also available in its directory within the unified corpus. Pinned data versions and documentation revisions are distinct.
Translation languages do not imply training-data coverage in those languages. The principal natural languages are Korean and English; web, math and code may contain other languages.
### Contents and scale
| | |
|---|---:|
| Source | github_code_v1 |
| Documents | 2,148,459 |
| Train documents | 2,125,938 |
| Evaluation documents | 22,521 |
| Text bytes | 3,584,084,955 |
| | |
|---|---:|
| tokens | 4,006,737,196 |
| eval tokens | 42,420,481 |
| revision | v1.0.0 |
| upstream | [codeparrot/github-code](https://huggingface.co/datasets/codeparrot/github-code/blob/b5661e6b17396364b2bcf8e68977b0d28e1ebd19/README.md) |
| upstream license | other |
| provenance_status | `repo_path_row_preserved_git_commit_unknown` |
### Processing and splits
Web processing applies whitespace cleanup, length/repetition/language heuristics and selected PII-pattern masking. Initial within-shard hashes differ from final web NFC SHA256. Code filtering preserves case, indentation and original Unicode while checking paths, license labels, generated code and selected secret patterns. Connected groups of identical bodies, NFC-equivalent web bodies and code repositories are assigned to train/eval.
### Usage
Run commands below from the repository root. Use new output/download directories and check scope, size and pinned revision first. The synthetic CPU example downloads no external data. Select only the needed files from the separate data releases and verify sizes/SHA256 against CHECKSUMS.json or the source manifests.
```bash
python -m pip install "pyarrow>=19,<20" "huggingface_hub>=0.34,<1" "tokenizers>=0.21,<0.23" "transformers==4.55.2" "requests>=2,<3"
```
```python
from huggingface_hub import snapshot_download
root = snapshot_download('pathcosmos/korean-pretrain-code', repo_type="dataset",
revision='v1.0.0', allow_patterns=['text/*.parquet', 'source.json', 'manifest.json', 'release.json', 'LICENSE-SCOPE.md'],
local_dir='korean-pretrain-code', token=False)
```
```python
from pathlib import Path
import subprocess, sys
from huggingface_hub import snapshot_download
reader = snapshot_download("pathcosmos/korean-pretrain-corpus", repo_type="dataset", revision="v1.1.0",
allow_patterns=["examples/*"], local_dir="corpus-reader", token=False)
subprocess.run([sys.executable, str(Path(reader) / "examples/stream_documents.py"),
"--repo", "pathcosmos/korean-pretrain-corpus", "--revision", "v1.1.0", "--source", "github_code_v1",
"--split", "train", "--limit", "10"], check=True)
```
[examples/stream_documents.py](https://huggingface.co/datasets/pathcosmos/korean-pretrain-corpus/blob/main/examples/stream_documents.py) · [manifest.json](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/manifest.json)
### Model and training
The model is a plain PyTorch dense decoder with RMSNorm, RoPE, GQA and SwiGLU. The actual3B path uses FSDP2,8GPUs and eager execution: context4096, micro batch4, global batch2,097,152tokens, peak LR3e-4 and target57,000steps. The CPU micro demonstration differs from distributed training. Exact resume requires model, optimizer, RNG and input/configuration contracts.
### Optimization and benchmarks
Experiments compare workers, threads, batches, SQLite caches, RAM, local/NFS storage, eager/compile execution, precision and GPU memory. Total time, throughput, peak memory and content/numerical equivalence accompany adoption or rejection decisions.47 campaigns and99 result JSON files are included. Speed alone does not justify a numerically failing candidate, and a small sample does not establish a full-scale optimum.
### Validation
The GH source release passed284 independent CPU tests with9 skips; fresh GitHub CPU CI passed258 with35 skips. Skips require original-run records or a second filesystem. The synthetic quickstart uses120documents, train100/eval20, vocab272 and a108,864parameter model, verifying exact model/optimizer resume. Dataset content-hash, split and reader checks are separate from full independent3B reproduction.
[release.json](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/release.json) · [source.json](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/source.json)
### Sources and licensing
Original project code is MIT and original prose is CC BY4.0. These grants do not replace original-content rights. Consult source.json, LICENSE-SCOPE.md and provenance documents for source-specific conditions, attribution, notices and known unresolved items. Unrestricted commercial redistribution of every original text is not asserted.
[codeparrot/github-code](https://huggingface.co/datasets/codeparrot/github-code/blob/b5661e6b17396364b2bcf8e68977b0d28e1ebd19/README.md) · [source.json](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/source.json) · [LICENSE-SCOPE.md](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/LICENSE-SCOPE.md)
### Limitations
Global near-duplicate removal, complete PII/secret removal, contamination-free official evaluation and final model quality are not guaranteed. Main training was ongoing at the publication snapshot; SFT, model export and official language benchmarks are not completed features.11 historical code references/9unique hashes lack a recovered snapshot. Some operational tools require original-run manifests.
### Related repositories
[GitHub](https://github.com/pathcosmos/korean-dense-llm/blob/main/cards/README.en.md) · [README](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code)
[GH / Usage](https://github.com/pathcosmos/korean-dense-llm/blob/main/docs/PUBLIC_GUIDE.md) · [GH / Optimization and benchmarks](https://github.com/pathcosmos/korean-dense-llm/blob/main/experiments/README.md) · [GH / Validation](https://github.com/pathcosmos/korean-dense-llm/blob/main/docs/PUBLIC_VALIDATION.md)
- [korean-pretrain-corpus](https://huggingface.co/datasets/pathcosmos/korean-pretrain-corpus/blob/main/cards/README.en.md)
- [korean-pretrain-training-data](https://huggingface.co/datasets/pathcosmos/korean-pretrain-training-data/blob/main/cards/README.en.md)
- [korean-pretrain-wikipedia](https://huggingface.co/datasets/pathcosmos/korean-pretrain-wikipedia/blob/main/cards/README.en.md)
- [korean-pretrain-fineweb2](https://huggingface.co/datasets/pathcosmos/korean-pretrain-fineweb2/blob/main/cards/README.en.md)
- [korean-pretrain-hplt2](https://huggingface.co/datasets/pathcosmos/korean-pretrain-hplt2/blob/main/cards/README.en.md)
- [korean-pretrain-fineweb-edu](https://huggingface.co/datasets/pathcosmos/korean-pretrain-fineweb-edu/blob/main/cards/README.en.md)
- [korean-pretrain-math](https://huggingface.co/datasets/pathcosmos/korean-pretrain-math/blob/main/cards/README.en.md)
- [korean-pretrain-code](https://huggingface.co/datasets/pathcosmos/korean-pretrain-code/blob/main/cards/README.en.md)
- [wiki_ko/](https://huggingface.co/datasets/pathcosmos/korean-pretrain-corpus/tree/main/wiki_ko)
- [fineweb2_ko/](https://huggingface.co/datasets/pathcosmos/korean-pretrain-corpus/tree/main/fineweb2_ko)
- [hplt_ko/](https://huggingface.co/datasets/pathcosmos/korean-pretrain-corpus/tree/main/hplt_ko)
- [fineweb_edu/](https://huggingface.co/datasets/pathcosmos/korean-pretrain-corpus/tree/main/fineweb_edu)
- [owm/](https://huggingface.co/datasets/pathcosmos/korean-pretrain-corpus/tree/main/owm)
- [github_code_v1/](https://huggingface.co/datasets/pathcosmos/korean-pretrain-corpus/tree/main/github_code_v1)
|