Datasets:
The dataset viewer is not available for this split.
Error code: StreamingRowsError
Exception: TypeError
Message: Couldn't cast array of type string to null
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 478, 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 2818, in __iter__
for key, example in ex_iterable:
^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2355, in __iter__
for key, pa_table in self._iter_arrow():
~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2380, in _iter_arrow
for key, pa_table in self.ex_iterable._iter_arrow():
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 536, in _iter_arrow
for key, pa_table in iterator:
^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 419, in _iter_arrow
for key, pa_table in self.generate_tables_fn(**gen_kwags):
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 343, in _generate_tables
self._cast_table(pa_table, json_field_paths=json_field_paths),
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
pa_table = table_cast(pa_table, self.info.features.arrow_schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2369, in table_cast
return cast_table_to_schema(table, schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2303, in cast_table_to_schema
cast_array_to_feature(
~~~~~~~~~~~~~~~~~~~~~^
table[name] if name in table_column_names else pa.array([None] * len(table), type=schema.field(name).type),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
feature,
^^^^^^^^
)
^
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1852, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2143, in cast_array_to_feature
return array_cast(
array,
...<2 lines>...
allow_decimal_to_str=allow_decimal_to_str,
)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1854, in wrapper
return func(array, *args, **kwargs)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2005, in array_cast
raise TypeError(f"Couldn't cast array of type {_short_str(array.type)} to {_short_str(pa_type)}")
TypeError: Couldn't cast array of type string to nullNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
Dataset Card for Code Corpus code-v1
Dataset Description
Dataset Summary
Code Corpus code-v1 is a token-balanced collection of source code, commit messages and
diffs, programming Q&A, and technical text. It is intended for language-model pretraining
and continued pretraining. All examples use a common JSONL schema with per-record
provenance, license metadata, exact token counts, and content hashes.
The released dataset contains 2 billion tokens, 2,541,336 documents, and 46
gzip-compressed shards totaling 2.91 GB (2,905,546,899 bytes; 2.71 GiB).
Exact source totals and the complete shard inventory are recorded in
manifest.json.
Supported Tasks
The dataset is designed for causal language modeling over code and technical text. It is not an instruction-tuning dataset and does not include labels, preference pairs, or a held-out evaluation split.
Languages
The corpus contains many programming languages and predominantly English natural-language
content. Other human languages may occur in source comments, commit messages, repository
content, and upstream technical-text collections. The language field describes a
programming language when upstream metadata is available; it is not a human-language tag.
Dataset Structure
Data Instances
Each line in a decompressed shard is an independent JSON object:
{
"id": "29266961adb8c59a77001330377561454f9d82e5dadfeff7445a14ae147ac453",
"text": "// source code, technical text, or a commit message and diff",
"source": "stackv2_edu",
"source_id": "6396980ea790ba1a35f35ff6269bb0d8d0b58ddf",
"language": "JavaScript",
"license": "MIT",
"url": "https://raw.githubusercontent.com/...",
"repository": "owner/repository",
"path": "/path/to/file.js",
"created": "2020-03-02 08:38:22",
"metadata": {},
"content_sha256": "72f9484f64be497baa6bd276fbfdbed13e43735445f0aedb635907314d223ceb",
"chunk_index": 0,
"token_count": 599
}
CommitPack examples format text as a natural-language commit message followed by a
unified diff.
Data Fields
| Field | Type | Description |
|---|---|---|
id |
string | Stable SHA-256 record identifier. |
text |
string | Model training text. |
source |
string | Source name matching a recipe entry and shard directory. |
source_id |
string or null | Upstream example identifier. |
language |
string or null | Upstream or detected programming language. |
license |
string or null | Upstream license label for the example. |
url |
string or null | Original or raw-content URL when available. |
repository |
string or null | Repository name when available. |
path |
string or null | Path within the repository when available. |
created |
string or null | Upstream timestamp; formatting varies by source. |
metadata |
object | Source-specific provenance and attributes. |
content_sha256 |
string | SHA-256 hash used for exact content deduplication. |
chunk_index |
integer | Zero-based index when a long document is split. |
token_count |
integer | Exact text token count using the configured tokenizer. |
Missing provenance is represented as null, not inferred. Consumers should allow
source-specific keys in metadata.
Data Splits
There is one train split. The recipe targets the following token mixture:
| Source | Upstream dataset | Share | Nominal tokens |
|---|---|---|---|
stackv2_edu |
common-pile/stackv2_edu_filtered |
65.0% | 1,300,000,000 |
stackv2_production |
common-pile/stackv2 |
10.0% | 200,000,000 |
commitpack |
bigcode/commitpackft |
8.0% | 160,000,000 |
stackexchange_programming |
common-pile/stackexchange_filtered |
7.0% | 140,000,000 |
arxiv_cs_math |
common-pile/arxiv_papers_filtered |
5.0% | 100,000,000 |
repository_docs |
common-pile/stackv2_edu_filtered |
2.9% | 58,000,000 |
python_peps |
common-pile/python_enhancement_proposals_filtered |
0.1% | 2,000,000 |
wikimedia |
common-pile/wikimedia_filtered |
2.0% | 40,000,000 |
If an upstream source is exhausted before filling its nominal allocation, the shortfall is
assigned to stackv2_edu. The manifest records the realized source proportions;
recipe.json records the target mixture and selection rules.
Loading the Dataset
After upload to the Hub:
from datasets import load_dataset
dataset = load_dataset("owenqwenllmwine/code-v1", split="train")
To load this directory locally:
dataset = load_dataset(
"json",
data_files="data/*/train-*.jsonl.gz",
split="train",
)
The card's default configuration maps all compressed JSONL shards to the train split.
Dataset Creation
Curation Rationale
The recipe emphasizes educational source code while retaining smaller amounts of production code, code changes, programming discussions, repository documentation, papers, standards, and general text. Source shares are allocated by tokenizer tokens rather than document count or compressed size.
Source Data
The data is derived from the upstream Hugging Face datasets linked above. The recipe uses
seed 42, a 10,000-example streaming shuffle buffer, a minimum document length of 32
tokens, and a maximum chunk length of 32,768 tokens. Token counts use
Qwen/Qwen3.5-0.8B-Base.
Processing includes:
- normalization into the common record schema;
- exact cross-source deduplication;
- long-document chunking;
- redaction of private-key blocks and common live-token patterns; and
- filtering of empty, repetitive, minified, generated, and common vendor-path content.
Educational code excludes documentation and notebooks. Production code additionally excludes common text, lock, source-map, and tabular files. Programming Q&A is restricted to selected programming-focused Stack Exchange sites. The exact filters are recorded in the recipe.
Annotations
No new labels or human annotations were created. Language, license, provenance, and other attributes are retained or normalized from upstream metadata.
Personal and Sensitive Information
Public source code and technical discussions can contain names, email addresses, usernames, URLs, credentials, or other personal and sensitive information. Automated secret-pattern redaction reduces some credential exposure but is not comprehensive. No dedicated PII removal or privacy audit has been performed.
Considerations for Using the Data
Intended Use
Appropriate uses include language-model pretraining, continued pretraining, and research on code and technical text. Users should retain provenance where needed for attribution and perform additional filtering, decontamination, or safety review appropriate to their use case.
Out-of-Scope Use
The corpus should not be treated as a source of verified, secure, up-to-date, or executable code. It is not suitable by itself for model evaluation, supervised instruction tuning, or applications that require factual correctness or license uniformity.
Biases, Risks, and Limitations
- Repository popularity, public availability, upstream sampling, and filtering choices affect which languages, communities, and software practices are represented.
- Examples may contain vulnerabilities, obsolete APIs, incorrect answers, toxic language, personal data, or other undesirable upstream artifacts.
- Exact duplicates are removed, but near-duplicates and benchmark contamination may remain.
- Language, license, timestamp, and provenance coverage varies by source.
- The buffered streaming shuffle is deterministic for the recorded configuration but is not a global random permutation.
- Several upstream revisions are unpinned, so the metadata may not be sufficient to recreate identical upstream streams in the future.
Licensing Information
This is a mixed-license dataset. Applicable terms vary by example and may include
permissive software licenses, public-domain material, open-content licenses, CC BY-SA, and
other licenses present in mixed-code sources. Per-record license and provenance information
is retained in license, url, repository, and metadata.
Users are responsible for reviewing and complying with the applicable terms, including attribution and share-alike requirements. License labels are inherited from upstream metadata and have not been independently verified. This dataset card is not legal advice.
Additional Information
Dataset Curators
Owen Qwen
Citation
@misc{qwen2026codev1,
author = {Owen Qwen},
title = {Code Corpus code-v1},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/datasets/owenqwenllmwine/code-v1}
}
Upstream Dataset Citations
All seven unique upstream dataset repositories are linked in Data Splits.
The six common-pile datasets share the Common Pile citation. The Stack V2-derived code
also uses The Stack V2 citation, while CommitPackFT uses the OctoPack citation.
@article{kandpal2025common,
title = {The Common Pile v0.1: An 8TB Dataset of Public Domain and Openly Licensed Text},
author = {Nikhil Kandpal and others},
journal = {arXiv preprint arXiv:2506.05209},
year = {2025},
url = {https://arxiv.org/abs/2506.05209}
}
@article{lozhkov2024starcoder2,
title = {StarCoder 2 and The Stack v2: The Next Generation},
author = {Anton Lozhkov and others},
journal = {arXiv preprint arXiv:2402.19173},
year = {2024},
url = {https://arxiv.org/abs/2402.19173}
}
@article{muennighoff2023octopack,
title = {OctoPack: Instruction Tuning Code Large Language Models},
author = {Niklas Muennighoff and Qian Liu and Armel Zebaze and Qinkai Zheng and
Binyuan Hui and Terry Yue Zhuo and Swayam Singh and Xiangru Tang and
Leandro von Werra and Shayne Longpre},
journal = {arXiv preprint arXiv:2308.07124},
year = {2023},
url = {https://arxiv.org/abs/2308.07124}
}
These scholarly citations do not replace the attribution, notice, or share-alike requirements of the licenses attached to individual records.
Reproducibility
manifest.json records the build timestamp, requested and realized token
counts, document and filter statistics, upstream revisions, tokenizer, and shard inventory.
recipe.json contains the complete source weights, filters, and processing
configuration for the release.
- Downloads last month
- 53