Dataset Viewer
Duplicate
The dataset viewer is not available for this split.
Cannot load the dataset split (in streaming mode) to extract the first rows.
Error code:   StreamingRowsError
Exception:    ValueError
Message:      invalid literal for int() with base 10: b's\x00\x00\x00\x00\x00\x00\x00\xb0\x0f\x00\x00\x00\x00\x00\x00&\x11\x00\x00\x00\x00\x00\x00\xd8"\x00\x00\x00\x00\x00\x00\x03(\x00\x00\x00\x00\x00\x00\xee2\x00\x00\x00\x00\x00\x00\x004\x00\x00\x00\x00
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/utils.py", line 147, in get_rows_or_raise
                  return get_rows(
                      dataset=dataset,
                  ...<4 lines>...
                      column_names=column_names,
                  )
                File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
                  return func(*args, **kwargs)
                File "/src/services/worker/src/worker/utils.py", line 127, in get_rows
                  rows_plus_one = list(itertools.islice(safe_iter(ds, dataset=dataset), rows_max_number + 1))
                File "/src/services/worker/src/worker/utils.py", line 483, in safe_iter
                  yield from ds.decode(False) if ds.features else ds
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2840, in __iter__
                  for key, example in ex_iterable:
                                      ^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2383, in __iter__
                  for key, example in self.ex_iterable:
                                      ^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 315, in __iter__
                  for key_example in islice(self.generate_examples_fn(**gen_kwargs), shard_example_idx_start, None):
                                     ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/webdataset/webdataset.py", line 127, in _generate_examples
                  for example_idx, example in enumerate(self._get_pipeline_from_tar(tar_path, tar_iterator)):
                                              ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/webdataset/webdataset.py", line 54, in _get_pipeline_from_tar
                  current_example[field_name] = cls.DECODERS[data_extension](current_example[field_name])
                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              ValueError: invalid literal for int() with base 10: b's\x00\x00\x00\x00\x00\x00\x00\xb0\x0f\x00\x00\x00\x00\x00\x00&\x11\x00\x00\x00\x00\x00\x00\xd8"\x00\x00\x00\x00\x00\x00\x03(\x00\x00\x00\x00\x00\x00\xee2\x00\x00\x00\x00\x00\x00\x004\x00\x00\x00\x00

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

LLM0to1 사전학습 토큰화본 — 코드

10B 규모 한/영 이중언어 LLM LLM0to1-10b 를 바닥부터 학습할 때 실제로 투입된 코드 코퍼스의 토큰화본. 총 27종 / 59.1B 토큰.

왜 원문 텍스트가 아니라 토큰화본인가

이 코퍼스들은 공개 데이터셋을 스트리밍으로 받아 곧바로 토큰화했고 중간 텍스트를 보관하지 않았다. 따라서 이 .ds 파일이 학습에 들어간 데이터의 유일한 사본이다.

단점만 있는 건 아니다. 토큰화본은 학습 입력 그 자체이므로, 재토큰화 과정에서 생길 수 있는 차이 없이 학습을 그대로 재현할 수 있다.

원본 출처

bigcode/starcoderdata(언어별 서브셋) · bigcode/commitpackft · bigcode/jupyter-code-text-pairs · deepmind/code_contests

code_ccode_c2 처럼 2 가 붙은 것은 정제기 v2(code_data_prep_v2.py)로 다시 만든 판이다. 둘 다 학습에 투입됐다.

수록 목록

코퍼스 토큰
code_c2 5.41B
code_cpp 4.62B
code_sql 4.52B
code_c 4.24B
code_cpp2 3.72B
code_go 3.33B
code_python2 3.26B
code_php 3.19B
code_c-sharp 3.07B
code_java2 2.68B
code_rust 2.61B
code_python 2.56B
code_javascript2 2.28B
code_java 2.10B
code_javascript 1.78B
code_kotlin 1.43B
code_typescript 1.30B
code_ruby 1.20B
code_shell 1.07B
code_lua 0.97B
code_dart 0.92B
code_scala 0.74B
code_assembly 0.68B
code_fortran 0.63B
code_julia 0.46B
code_erlang 0.22B
code_r 0.09B

파일 형식

각 코퍼스는 <코퍼스명>.tar.zst 하나로 묶여 있다. 압축을 풀면:

<코퍼스명>/
  00000_unshuffled.ds            토큰 ID 연속열 (uint32, little-endian)
  00000_unshuffled.ds.index      문서 경계 오프셋
  00000_unshuffled.ds.metadata   원본 파일·행 매핑
  00001_unshuffled.ds ...

datatrove/nanotron 토큰화 산출물이다. zstd 로 약 14% 까지 줄어드는데, vocab 이 160k 라 uint32 의 상위 2바이트가 대부분 0 이기 때문이다.

사용법

1) 내려받아 압축 풀기

huggingface-cli download izlley2/llm0to1-pt-tokenized-code --repo-type dataset --local-dir ./tok
cd tok && for f in *.tar.zst; do zstd -d "$f" -c | tar -x; done

2) 텍스트로 되돌려 내용 확인

import numpy as np
from transformers import AutoTokenizer

tok = AutoTokenizer.from_pretrained("izlley2/llm0to1-tokenizer")   # vocab 160k, byte-level BPE
ids = np.fromfile("<코퍼스명>/00000_unshuffled.ds", dtype=np.uint32)
print(f"{len(ids):,} 토큰")
print(tok.decode(ids[:2000]))

3) 학습에 바로 투입 (nanotron)

압축 푼 디렉토리를 config 의 데이터 폴더로 지정한다:

data_stages:
  - name: my_stage
    start_training_step: 1
    data:
      dataset:
        dataset_folder:
          /path/to/tok/<코퍼스명>: 1.0      # 값은 믹스 가중치

주의

  • 토크나이저가 반드시 이것이어야 한다izlley2/llm0to1-tokenizer. vocab 크기가 다른 토크나이저로 디코딩하면 완전히 다른 텍스트가 나온다.
  • .ds 는 문서 구분자 없이 이어붙인 토큰열이다. 문서 단위로 나누려면 .ds.index 를 함께 읽어야 한다.
  • 원본 데이터셋들의 라이선스가 각각 적용된다. 위 "원본 출처" 를 확인할 것.

관련

  • izlley2/llm0to1-repro-manifest — 코퍼스 116종 전체의 출처·전처리 스크립트·토큰수·믹스 가중치
  • izlley2/llm0to1-tokenizer — 토크나이저
  • izlley2/LLM0to1-10b-step20000, -step83000 — 사전학습 체크포인트(HF 포맷)
  • izlley2/LLM0to1-10b-step83000-nanotron — 같은 체크포인트(nanotron 포맷, 학습 재개용)

LLM0to1-10b 사전학습 재현용 아카이브.

Downloads last month
1