--- pretty_name: Custom GPT 40M Sangraha Subset license: cc-by-4.0 language: - en task_categories: - text-generation tags: - language-modeling - sangraha - tokenized - provenance size_categories: - 100K` token after each document. This tokenization and the train/validation split are transformations of the upstream corpus. ## Splitting and historical identity The notebook concatenates `data-0.parquet` then `data-1.parquet`, encodes texts using its custom BPE tokenizer, appends EOS, and cuts at `floor(0.9 * total_tokens)`. The training array is the prefix and validation is the suffix. **The split is not document-disjoint.** Document index 629,027, counting from zero, contributes 1,620 tokens to training and its remaining 294 tokens to validation. The tokenizer is fitted before this split in the notebook and can therefore learn vocabulary from validation text. Raw documents are exposed as a single `corpus` split. This avoids assigning entire documents to token-level train/validation splits they do not exactly match. Use the saved arrays for the exact training/validation boundaries. The packaged raw hashes match the upstream snapshot. All 261 deterministic sampled documents, including shard endpoints and the split-boundary document, reproduced their saved token spans exactly. This was a sample-based token reconstruction check, not a complete re-tokenization. The arrays have complete SHA-256 hashes and are copied unchanged from the local training artifacts. Their counts, matching samples, notebook and checkpoint metadata support the association with the run; the historical run has no external file-access log. There is no separate test split or instruction fine-tuning dataset for this model. The reported validation loss uses random token windows from `val_ids.npy`. ## Load the corpus ```python from datasets import load_dataset corpus = load_dataset( "sraivante/Custom-GPT-40M-Sangraha-Subset", "corpus", split="corpus", streaming=True, ) row = next(iter(corpus)) print(row.keys()) # doc_id, text, type ``` ## Load the exact token streams ```python import numpy as np from huggingface_hub import hf_hub_download from tokenizers import Tokenizer repo = "sraivante/Custom-GPT-40M-Sangraha-Subset" train_path = hf_hub_download(repo, "tokens/train_ids.npy", repo_type="dataset") val_path = hf_hub_download(repo, "tokens/val_ids.npy", repo_type="dataset") tok_path = hf_hub_download(repo, "bpe_tokenizer.json", repo_type="dataset") train = np.load(train_path, mmap_mode="r", allow_pickle=False) val = np.load(val_path, mmap_mode="r", allow_pickle=False) tokenizer = Tokenizer.from_file(tok_path) assert train.shape == (411919454,) assert val.shape == (45768829,) # Next-token training window; promote uint16 IDs to int64 for PyTorch. x = train[:256].astype("int64") y = train[1:257].astype("int64") ``` Special tokens: `=0`, `=1`, `=2`, `=3`. The tokenizer uses byte-level BPE with `add_prefix_space=True`; it does not automatically insert BOS or EOS. The corpus tokenizer was trained on text with line breaks normalized for tokenizer training, while the saved token arrays encode original text. Not every possible character is necessarily covered by its learned vocabulary. The raw files and arrays require approximately 2.11 GB together, before any Arrow cache or model files. Pin a repository commit in `revision=...` for later reproducibility; file hashes are also included in `SHA256SUMS`. ## Appropriate uses and limitations This snapshot supports reproducibility, English causal language modeling and small-model experiments. It represents only two English shards of Sangraha. It is not a representative sample of all English or all of Sangraha, and it contains no instruction/response annotations. Web articles, PDF extractions and transcriptions may contain mistakes, duplicated text, extraction noise, biases, offensive material, and names or other personal information that was present in the public sources. No additional de-identification, redaction, deduplication or content moderation was performed for this publication. The data should not be treated as verified ground truth or an independent downstream benchmark. ## Copyright and licensing The **corpus and token arrays are CC BY 4.0**; preserve AI4Bharat / Sangraha attribution, acknowledge original content creators, link the license and state your modifications. See [LICENSE](LICENSE) and [ATTRIBUTION.md](ATTRIBUTION.md). **Copyright (c) 2026 sraivante** applies only to original project code, original release documentation and original packaging contributions where copyright exists. Those contributions are licensed under [Apache License 2.0](LICENSE-APACHE-2.0). This does not transfer ownership of, or relicense, the third-party text. The model weights have their own Apache-2.0 release. Snapshot version: **2026-09-25**. Model, dataset, tokenizer, source revision and hashes are linked for this authorized release.