JustACluelessKidAtSchool commited on
Commit
8cf016b
·
verified ·
1 Parent(s): 3d6dfb0

Fix YAML task_categories to official dataset taxonomy: text-generation, question-answering

Browse files
Files changed (1) hide show
  1. README.md +53 -11
README.md CHANGED
@@ -33,7 +33,7 @@ configs:
33
 
34
  A state-of-the-art, balanced **7-domain** pre-training dataset engineered specifically for **Small Language Models (Tiny SLMs: 50M – 2B parameters)** such as SmolLM2, SmolLM3, MobileLLM, Llama 3.2 1B, and custom architectures.
35
 
36
- 100% compatible with **Unsloth Studio**, **Unsloth AI**, **Hugging Face **, and **PyTorch DataLoaders**.
37
 
38
  ---
39
 
@@ -53,24 +53,66 @@ A state-of-the-art, balanced **7-domain** pre-training dataset engineered specif
53
 
54
  | Domain | Source Repository | Description & Quality Filter | Token Share |
55
  | :--- | :--- | :--- | :--- |
56
- | **Synthetic Textbooks** | | textbooks and topic deep-dives | **28.0%** |
57
- | **Educational Web** | | Sample 10BT (score >= 2.8 filter) | **23.5%** |
58
- | **Step-by-Step Math** | | & (score 4+) | **19.5%** |
59
- | **Clean Polyglot Code** | | Python, Rust, C++, C, Go, JS, TS, Java, SQL, Shell | **12.5%** |
60
- | **General Knowledge** | + | English Wikipedia (dense factual) & DCLM web corpus | **7.8%** |
61
- | **Reasoning & Tool Traces** | | OpenThoughts3, Nemotron R1, and agentic tool traces | **6.5%** |
62
- | **Stories & Narrative** | | Synthetic coherent narrative, dialogue, & vocabulary | **2.1%** |
63
 
64
  ---
65
 
66
  ## 🦥 Quickstart: Unsloth Studio & Hugging Face
67
 
68
  ### 1. Load with Hugging Face Datasets
 
 
69
 
 
 
70
 
71
- ### 2. Pre-Train with Unsloth in 1 Command
 
 
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
  ### 3. In Unsloth Studio GUI
75
- 1. Set Dataset to:
76
- 2. Text Column:
 
33
 
34
  A state-of-the-art, balanced **7-domain** pre-training dataset engineered specifically for **Small Language Models (Tiny SLMs: 50M – 2B parameters)** such as SmolLM2, SmolLM3, MobileLLM, Llama 3.2 1B, and custom architectures.
35
 
36
+ 100% compatible with **Unsloth Studio**, **Unsloth AI**, **Hugging Face `datasets`**, and **PyTorch DataLoaders**.
37
 
38
  ---
39
 
 
53
 
54
  | Domain | Source Repository | Description & Quality Filter | Token Share |
55
  | :--- | :--- | :--- | :--- |
56
+ | **Synthetic Textbooks** | `HuggingFaceTB/smollm-corpus` | `cosmopedia-v2` textbooks and topic deep-dives | **28.0%** |
57
+ | **Educational Web** | `HuggingFaceFW/fineweb-edu` | Sample 10BT (score >= 2.8 filter) | **23.5%** |
58
+ | **Step-by-Step Math** | `HuggingFaceTB/finemath` | `finemath-4plus` & `infiwebmath-4plus` (score 4+) | **19.5%** |
59
+ | **Clean Polyglot Code** | `codeparrot/github-code-clean` | Python, Rust, C++, C, Go, JS, TS, Java, SQL, Shell | **12.5%** |
60
+ | **General Knowledge** | `wikimedia/wikipedia` + `mlfoundations/dclm-baseline-1.0-parquet` | English Wikipedia (dense factual) & DCLM web corpus | **7.8%** |
61
+ | **Reasoning & Tool Traces** | `HuggingFaceTB/smoltalk2` | OpenThoughts3, Nemotron R1, and agentic tool traces | **6.5%** |
62
+ | **Stories & Narrative** | `roneneldan/TinyStories` | Synthetic coherent narrative, dialogue, & vocabulary | **2.1%** |
63
 
64
  ---
65
 
66
  ## 🦥 Quickstart: Unsloth Studio & Hugging Face
67
 
68
  ### 1. Load with Hugging Face Datasets
69
+ ```python
70
+ from datasets import load_dataset
71
 
72
+ # Load Train Split
73
+ train_dataset = load_dataset("JustACluelessKidAtSchool/tiny-slm-pretraining-corpus", split="train")
74
 
75
+ # Load Validation Split
76
+ val_dataset = load_dataset("JustACluelessKidAtSchool/tiny-slm-pretraining-corpus", split="validation")
77
+ ```
78
 
79
+ ### 2. Pre-Train with Unsloth in 1 Command
80
+ ```python
81
+ from unsloth import FastLanguageModel
82
+ from datasets import load_dataset
83
+ from transformers import TrainingArguments
84
+ from trl import SFTTrainer
85
+
86
+ # Load Tiny Model (e.g. SmolLM2-135M or Llama-3.2-1B)
87
+ model, tokenizer = FastLanguageModel.from_pretrained(
88
+ model_name="HuggingFaceTB/SmolLM2-135M",
89
+ max_seq_length=2048,
90
+ load_in_4bit=False,
91
+ )
92
+
93
+ # Load Dataset from Hub
94
+ dataset = load_dataset("JustACluelessKidAtSchool/tiny-slm-pretraining-corpus", split="train")
95
+
96
+ # Train with Unsloth
97
+ trainer = SFTTrainer(
98
+ model=model,
99
+ tokenizer=tokenizer,
100
+ train_dataset=dataset,
101
+ dataset_text_field="text",
102
+ max_seq_length=2048,
103
+ args=TrainingArguments(
104
+ output_dir="./tiny_slm_output",
105
+ per_device_train_batch_size=4,
106
+ gradient_accumulation_steps=8,
107
+ max_steps=5000,
108
+ learning_rate=5e-4,
109
+ fp16=True,
110
+ optim="adamw_8bit",
111
+ ),
112
+ )
113
+ trainer.train()
114
+ ```
115
 
116
  ### 3. In Unsloth Studio GUI
117
+ 1. Set Dataset to: `JustACluelessKidAtSchool/tiny-slm-pretraining-corpus`
118
+ 2. Text Column: `text`