tokenizer: fixed phi 4 tokenizer based on unsloth suggestions
Browse files- merges.txt +0 -0
- misc/logo.jpg +0 -0
- scripts/backup/base_instruct_datasets.py +124 -0
- scripts/backup/base_reason_datasets.py +79 -0
- scripts/backup/cpt_base_datasets.py +58 -0
- scripts/backup/cpt_base_model.py +101 -0
- scripts/backup/cpt_instruct_datasets.py +119 -0
- scripts/backup/merge-core-into-base.yaml +100 -0
- scripts/backup/prepare_pretrain_base_datasets.py +59 -0
- scripts/backup/pretrain_base_datasets.py +107 -0
- scripts/backup/pretrain_instruct_datasets.py +198 -0
- scripts/backup/pretrain_reasoning_datasets.py +98 -0
- scripts/backup/pretrain_reflection_datasets.py +39 -0
- scripts/backup/unsloth_utils.py +125 -0
- scripts/core_base_datasets.py +89 -0
- scripts/core_instruct_datasets.py +43 -0
- scripts/prepare_core_datasets.py +59 -0
- scripts/pretrain-core-model-0.yaml +150 -0
- scripts/requirements.in +19 -0
- scripts/utils.py +126 -0
- special_tokens_map.json +6 -0
- tokenizer.json +3 -0
- tokenizer_config.json +781 -0
- vocab.json +0 -0
merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
misc/logo.jpg
ADDED
![]() |
scripts/backup/base_instruct_datasets.py
ADDED
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
roles_map = {
|
2 |
+
'system': 'system',
|
3 |
+
'user': 'user',
|
4 |
+
'human': 'user',
|
5 |
+
'assistant': 'assistant',
|
6 |
+
'gpt': 'assistant',
|
7 |
+
'AI': 'assistant',
|
8 |
+
}
|
9 |
+
|
10 |
+
|
11 |
+
core_instruct_datasets = [
|
12 |
+
#
|
13 |
+
# general instructs
|
14 |
+
#
|
15 |
+
# 1.48 GB, 1,420,909
|
16 |
+
# mlabonne/open-perfectblend
|
17 |
+
# meta-math/MetaMathQA 395,000
|
18 |
+
# openbmb/UltraInteract_sft 288,579
|
19 |
+
# HuggingFaceH4/ultrachat_200k 207,865
|
20 |
+
# microsoft/orca-math-word-problems-200k 200,035
|
21 |
+
# HuggingFaceH4/ultrafeedback_binarized 187,405
|
22 |
+
# theblackcat102/evol-codealpaca-v1 111,272
|
23 |
+
# Post-training-Data-Flywheel/AutoIF-instruct-61k 61,492
|
24 |
+
# mlabonne/lmsys-arena-human-preference-55k-sharegpt 57,362
|
25 |
+
*[
|
26 |
+
{'kind': 'instruct', 'path': 'mlabonne/open-perfectblend', 'split': f'train[{i}%:{i + 10}%]', 'field': 'conversations', 'transform': lambda msgs: [
|
27 |
+
{'role': roles_map[m['from']], 'content': m['value']}
|
28 |
+
for m in msgs
|
29 |
+
]}
|
30 |
+
for i in range(0, 100, 10)
|
31 |
+
],
|
32 |
+
# 1.41 GB, 939,343
|
33 |
+
# allenai/tulu-3-sft-mixture
|
34 |
+
# CoCoNot (ODC-BY-1.0), 10,983 prompts (Brahman et al., 2024)
|
35 |
+
# FLAN v2 via ai2-adapt-dev/flan_v2_converted, 89,982 prompts (Longpre et al., 2023)
|
36 |
+
# No Robots (CC-BY-NC-4.0), 9,500 prompts (Rajani et al. 2023)
|
37 |
+
# OpenAssistant Guanaco (Apache 2.0), 7,132 prompts (Kopf et al., 2024)
|
38 |
+
# Tulu 3 Persona MATH (ODC-BY-1.0), 149,960 prompts
|
39 |
+
# Tulu 3 Persona GSM (ODC-BY-1.0), 49,980 prompts
|
40 |
+
# Tulu 3 Persona Python (ODC-BY-1.0), 34,999 prompts
|
41 |
+
# Tulu 3 Persona Algebra (ODC-BY-1.0), 20,000 prompts
|
42 |
+
# Tulu 3 Persona IF (ODC-BY-1.0), 29,980 prompts
|
43 |
+
# NuminaMath-TIR (Apache 2.0), 64,312 prompts (Beeching et al. 2024)
|
44 |
+
# Tulu 3 WildGuardMix (Apache 2.0), 50,000 prompts (Han et al., 2024)
|
45 |
+
# Tulu 3 WildJailbreak (ODC-BY-1.0), 50,000 prompts (Wildteaming, 2024)
|
46 |
+
# Tulu 3 Hardcoded (CC-BY-4.0), 240 prompts
|
47 |
+
# Aya (Apache 2.0), 100,000 prompts (Singh et al., 2024)
|
48 |
+
# WildChat GPT-4 (ODC-BY-1.0), 100,000 prompts (Zhao et al., 2024)
|
49 |
+
# TableGPT (MIT), 5,000 prompts (Zha et al., 2023)
|
50 |
+
# SciRIFF (ODC-BY-1.0), 10,000 prompts (Wadden et al., 2024)
|
51 |
+
# Evol CodeAlpaca (Apache 2.0), 107,276 prompts (Luo et al., 2023)
|
52 |
+
*[
|
53 |
+
{'kind': 'instruct', 'path': 'allenai/tulu-3-sft-mixture', 'split': f'train[{i}%:{i + 10}%]', 'field': 'messages'}
|
54 |
+
for i in range(0, 100, 10)
|
55 |
+
],
|
56 |
+
|
57 |
+
#
|
58 |
+
# multilingual instructs
|
59 |
+
#
|
60 |
+
# 2.48 GB, 5,808,694
|
61 |
+
# rombodawg/Everything_Instruct_Multilingual
|
62 |
+
# Science:
|
63 |
+
# antiven0m/physical-reasoning-dpoScience
|
64 |
+
# LawalAfeez/science-dataset
|
65 |
+
# Social media:
|
66 |
+
# Kyle1668/AG-Tweets
|
67 |
+
# euclaise/reddit-instruct-curated
|
68 |
+
# General Knowledge:
|
69 |
+
# NousResearch/CharacterCodex_Characters
|
70 |
+
# jstet/quotes-500k_Famous_Quotes
|
71 |
+
# FronkonGames/steam-games-dataset_Video_Games
|
72 |
+
# totuta_youtube_subs_howto100M_HowTo
|
73 |
+
# Multi-lingual:
|
74 |
+
# Amani27/massive_translation_dataset
|
75 |
+
# udmurtNLP/udmurt-russian-english-labse
|
76 |
+
# grosenthal/latin_english
|
77 |
+
# msarmi9/korean-english-multitarget-ted-talks-task
|
78 |
+
# HaiderSultanArc/MT-Urdu-English_Translate
|
79 |
+
# Garsa3112/ChineseEnglishTranslationDataset
|
80 |
+
# Cooking:
|
81 |
+
# andrewsiah/se_cooking_preference_sft
|
82 |
+
# Hieu-Phamkaggle/food_recipes
|
83 |
+
# Writing:
|
84 |
+
# shahules786/PoetryFoundationData
|
85 |
+
# euclaise/writingprompts
|
86 |
+
# qwedsacf/ivypanda-essaysEssay
|
87 |
+
# Medicine:
|
88 |
+
# keivalya/MedQuad-MedicalQnADataset
|
89 |
+
# nuvocare/MSD
|
90 |
+
# History:
|
91 |
+
# ambrosfitz10k/history_data_v4
|
92 |
+
# Law:
|
93 |
+
# dzunggg/legal-qa-v1
|
94 |
+
# Role-Play:
|
95 |
+
# roleplay4/fun_CoupleRP
|
96 |
+
# Undi95andrijdavid/roleplay-conversation-sharegpt
|
97 |
+
# News:
|
98 |
+
# RealTimeData/bbc_news_alltime
|
99 |
+
# Coding: (rombodawg/code_bagel)
|
100 |
+
# layoric/tiny-codes-alpaca
|
101 |
+
# glaiveai/glaive-code-assistant-v3
|
102 |
+
# ajibawa-2023/Code-290k-ShareGPT
|
103 |
+
# chargoddard/commitpack-ft-instruct-rated
|
104 |
+
# iamtarun/code_instructions_120k_alpaca
|
105 |
+
# ise-uiuc/Magicoder-Evol-Instruct-110K
|
106 |
+
# cognitivecomputations/dolphin-coder
|
107 |
+
# nickrosh/Evol-Instruct-Code-80k-v1
|
108 |
+
# coseal/CodeUltraFeedback_binarized
|
109 |
+
# CyberNative/Code_Vulnerability_Security_DPO
|
110 |
+
# Math: (rombodawg/code_bagel)
|
111 |
+
# TIGER-Lab/MathInstruct
|
112 |
+
# Function calling: (rombodawg/code_bagel)
|
113 |
+
# glaiveai/glaive-function-calling-v2
|
114 |
+
# General Instruct: (rombodawg/OpenHermes-2.5-Uncensored)
|
115 |
+
# teknium/OpenHermes-2.5
|
116 |
+
*[
|
117 |
+
{'kind': 'instruct', 'path': 'rombodawg/Everything_Instruct_Multilingual', 'split': f'train[{i}%:{i + 10}%]', 'transform': lambda r: [
|
118 |
+
{'role': 'system', 'content': r['instruction']},
|
119 |
+
{'role': 'user', 'content': r['input']},
|
120 |
+
{'role': 'assistant', 'content': r['output']},
|
121 |
+
]}
|
122 |
+
for i in range(0, 100, 10)
|
123 |
+
],
|
124 |
+
]
|
scripts/backup/base_reason_datasets.py
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
roles_map = {
|
2 |
+
'system': 'system',
|
3 |
+
'user': 'user',
|
4 |
+
'human': 'user',
|
5 |
+
'assistant': 'assistant',
|
6 |
+
'gpt': 'assistant',
|
7 |
+
'AI': 'assistant',
|
8 |
+
}
|
9 |
+
|
10 |
+
R1_SYSTEM_PROMPT = '''\
|
11 |
+
You are an AI assistant.
|
12 |
+
|
13 |
+
Your primary directive is to provide well-reasoned, structured, and extensively detailed responses.
|
14 |
+
|
15 |
+
Formatting Requirements:
|
16 |
+
- Always structure your replies using: <think>{reasoning}</think>{answer}
|
17 |
+
- The <think></think> block should contain at least six reasoning steps when applicable.
|
18 |
+
- If the answer requires minimal thought, the <think></think> block may be left empty.
|
19 |
+
- The user does not see the <think></think> section. Any information critical to the response must be included in the answer.
|
20 |
+
- If you notice that you have engaged in circular reasoning or repetition, immediately terminate {reasoning} with a </think> and proceed to the {answer}
|
21 |
+
|
22 |
+
Response Guidelines:
|
23 |
+
- Detailed and Structured: Use rich Markdown formatting for clarity and readability.
|
24 |
+
- Scientific and Logical Approach: Your explanations should reflect the depth and precision of the greatest scientific minds.
|
25 |
+
- Prioritize Reasoning: Always reason through the problem first, unless the answer is trivial.
|
26 |
+
- Concise yet Complete: Ensure responses are informative, yet to the point without unnecessary elaboration.
|
27 |
+
- Maintain a professional, intelligent, and analytical tone in all interactions.'''
|
28 |
+
|
29 |
+
core_reason_datasets = [
|
30 |
+
#
|
31 |
+
# math reason
|
32 |
+
#
|
33 |
+
# 8.43 GB, 450,258
|
34 |
+
*[
|
35 |
+
{'kind': 'instruct', 'path': 'open-r1/OpenR1-Math-220k', 'data_dir': 'data', 'split': f'train[{i}%:{i + 10}%]', 'field': 'messages', 'transform': lambda msgs: [
|
36 |
+
{'role': roles_map[m['from']], 'content': m['value']}
|
37 |
+
for m in msgs
|
38 |
+
]}
|
39 |
+
for i in range(0, 100, 10)
|
40 |
+
],
|
41 |
+
|
42 |
+
#
|
43 |
+
# general reason
|
44 |
+
#
|
45 |
+
# 3.55 GB, 227,914
|
46 |
+
*[
|
47 |
+
{'kind': 'instruct', 'path': 'open-thoughts/OpenThoughts-114k', 'data_dir': 'data', 'split': f'train[{i}%:{i + 10}%]', 'transform': lambda r: [
|
48 |
+
{'role': 'system', 'content': r['system']}
|
49 |
+
] + [
|
50 |
+
{'role': roles_map[m['from']], 'content': m['value']}
|
51 |
+
for m in r['conversations']
|
52 |
+
]}
|
53 |
+
for i in range(0, 100, 10)
|
54 |
+
],
|
55 |
+
# 3.98 GB, 814,334
|
56 |
+
# 300k
|
57 |
+
*[
|
58 |
+
{'kind': 'instruct', 'path': 'cognitivecomputations/dolphin-r1', 'data_files': 'dolphin-r1-reasoning-deepseek.jsonl', 'split': f'train[{i}%:{i + 10}%]', 'transform': lambda r: [
|
59 |
+
{'role': 'system', 'content': R1_SYSTEM_PROMPT},
|
60 |
+
*r['messages'],
|
61 |
+
{'role': 'assistant', 'content': '<think>\n' + (r.get('reasoning') or '') + '\n</think>\n' + (r.get('answer') or '')},
|
62 |
+
]}
|
63 |
+
for i in range(0, 100, 10)
|
64 |
+
],
|
65 |
+
# 300k
|
66 |
+
*[
|
67 |
+
{'kind': 'instruct', 'path': 'cognitivecomputations/dolphin-r1', 'data_files': 'dolphin-r1-reasoning-flash.jsonl', 'split': f'train[{i}%:{i + 10}%]', 'transform': lambda r: [
|
68 |
+
{'role': 'system', 'content': R1_SYSTEM_PROMPT},
|
69 |
+
*r['messages'],
|
70 |
+
{'role': 'assistant', 'content': '<think>\n' + (r.get('reasoning') or '') + '\n</think>\n' + (r.get('answer') or '')},
|
71 |
+
]}
|
72 |
+
for i in range(0, 100, 10)
|
73 |
+
],
|
74 |
+
# 21.1 MB, 1,000
|
75 |
+
{'kind': 'instruct', 'path': 'simplescaling/s1K-1.1', 'split': 'train', 'transform': lambda r: [
|
76 |
+
{'role': 'user', 'content': r.get('question') or ''},
|
77 |
+
{'role': 'assistant', 'content': '<think>\n' + (r.get('deepseek_thinking_trajectory') or '') + '\n</think>\n' + (r.get('solution') or '')},
|
78 |
+
]}
|
79 |
+
]
|
scripts/backup/cpt_base_datasets.py
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
cpt_base_datasets = [
|
2 |
+
#
|
3 |
+
# stem
|
4 |
+
#
|
5 |
+
# 1.44 GB, 63,357
|
6 |
+
{'kind': 'base', 'path': 'neuralwork/arxiver', 'split': 'train', 'format': lambda n: n['abstract']},
|
7 |
+
{'kind': 'base', 'path': 'neuralwork/arxiver', 'split': 'train', 'format': lambda n: n['markdown']},
|
8 |
+
|
9 |
+
#
|
10 |
+
# code
|
11 |
+
#
|
12 |
+
# 1.62 GB, 1,632,309
|
13 |
+
# Python, TypeScript, JavaScript, Ruby, Julia, Rust, C++, Bash, Java, C#, and Go; SQL, Cypher
|
14 |
+
{'kind': 'base', 'path': 'nampdn-ai/tiny-codes', 'split': 'train', 'format': '{prompt} {response}'},
|
15 |
+
|
16 |
+
#
|
17 |
+
# misc
|
18 |
+
#
|
19 |
+
# 472 KB, 5,034
|
20 |
+
{'kind': 'base', 'path': 'badrex/llm-emoji-dataset', 'format': '{short description}. {LLM description}. {character}'},
|
21 |
+
|
22 |
+
#
|
23 |
+
# multilingual
|
24 |
+
#
|
25 |
+
# 742 MB, 321,697
|
26 |
+
*[
|
27 |
+
{'kind': 'base', 'path': 'data-silence/sumnews', 'split': split, 'format': lambda n: n[field]}
|
28 |
+
for split in ['train', 'test']
|
29 |
+
for field in ['title', 'resume', 'news']
|
30 |
+
],
|
31 |
+
# 193 MB, 1,141,967
|
32 |
+
*[
|
33 |
+
{'kind': 'base', 'path': 'xu-song/cc100-samples', 'name': name, 'split': 'train', 'format': lambda n: n['text']}
|
34 |
+
for name in [
|
35 |
+
'am', 'ar', 'as', 'az', 'be', 'bg', 'bn', 'bn_rom', 'br',
|
36 |
+
'bs', 'ca', 'cs', 'cy', 'da', 'de', 'el', 'en', 'eo', 'es',
|
37 |
+
'et', 'eu', 'fa', 'ff', 'fi', 'fr', 'fy', 'ga', 'gd', 'gl',
|
38 |
+
'gn', 'gu', 'ha', 'he', 'hi', 'hi_rom', 'hr', 'ht', 'hu',
|
39 |
+
'hy', 'id', 'ig', 'is', 'it', 'ja', 'jv', 'ka', 'kk', 'km',
|
40 |
+
'kn', 'ko', 'ku', 'ky', 'la', 'lg', 'li', 'ln', 'lo', 'lt',
|
41 |
+
'lv', 'mg', 'mk', 'ml', 'mn', 'mr', 'ms', 'my', 'my_zaw',
|
42 |
+
'ne', 'nl', 'no', 'ns', 'om', 'or', 'pa', 'pl', 'ps', 'pt',
|
43 |
+
'qu', 'rm', 'ro', 'ru', 'sa', 'si', 'sc', 'sd', 'sk', 'sl',
|
44 |
+
'so', 'sq', 'sr', 'ss', 'su', 'sv', 'sw', 'ta', 'ta_rom',
|
45 |
+
'te', 'te_rom', 'th', 'tl', 'tn', 'tr', 'ug', 'uk', 'ur',
|
46 |
+
'ur_rom', 'uz', 'vi', 'wo', 'xh', 'yi', 'yo',
|
47 |
+
'zh-Hans', 'zh-Hant', 'zu',
|
48 |
+
]
|
49 |
+
],
|
50 |
+
|
51 |
+
#
|
52 |
+
# general knowledge
|
53 |
+
#
|
54 |
+
# 3.18 GB, 1,010,500 - uncompressed 6GB
|
55 |
+
{'kind': 'base', 'path': 'JeanKaddour/minipile', 'split': 'train', 'format': lambda n: n['text']},
|
56 |
+
{'kind': 'base', 'path': 'JeanKaddour/minipile', 'split': 'validation', 'format': lambda n: n['text']},
|
57 |
+
{'kind': 'base', 'path': 'JeanKaddour/minipile', 'split': 'test', 'format': lambda n: n['text']},
|
58 |
+
]
|
scripts/backup/cpt_base_model.py
ADDED
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from unsloth import FastLanguageModel
|
2 |
+
import torch
|
3 |
+
from transformers import AutoTokenizer
|
4 |
+
|
5 |
+
max_seq_length = 4096
|
6 |
+
dtype = torch.bfloat16
|
7 |
+
load_in_4bit = True
|
8 |
+
model_name = '../out/pretrain-base'
|
9 |
+
output_dir = '../out/cpt-base'
|
10 |
+
|
11 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
12 |
+
model_name=model_name,
|
13 |
+
max_seq_length=max_seq_length,
|
14 |
+
dtype=dtype,
|
15 |
+
load_in_4bit=load_in_4bit,
|
16 |
+
)
|
17 |
+
|
18 |
+
print('Ignore loaded tokenizer by FastLanguageModel.from_pretrained and using AutoTokenizer.from_pretrained')
|
19 |
+
tokenizer = AutoTokenizer.from_pretrained('..', trust_remote_code=True, use_fast=True)
|
20 |
+
|
21 |
+
print(f'{model=}')
|
22 |
+
print(f'{tokenizer=}')
|
23 |
+
|
24 |
+
model = FastLanguageModel.get_peft_model(
|
25 |
+
model,
|
26 |
+
r=64, # 128, # Choose any number > 0 ! Suggested 8, 16, 32, 64, 128
|
27 |
+
target_modules=[
|
28 |
+
"q_proj", "k_proj", "v_proj", "o_proj",
|
29 |
+
"gate_proj", "up_proj", "down_proj",
|
30 |
+
"embed_tokens", "lm_head",
|
31 |
+
], # Add for continual pretraining
|
32 |
+
lora_alpha=16,
|
33 |
+
lora_dropout=0, # Supports any, but = 0 is optimized
|
34 |
+
bias='none', # Supports any, but = "none" is optimized
|
35 |
+
# [NEW] "unsloth" uses 30% less VRAM, fits 2x larger batch sizes!
|
36 |
+
use_gradient_checkpointing='unsloth', # True or "unsloth" for very long context
|
37 |
+
random_state=23,
|
38 |
+
use_rslora=True, # We support rank stabilized LoRA
|
39 |
+
loftq_config=None, # And LoftQ
|
40 |
+
)
|
41 |
+
|
42 |
+
print(f'{model=}')
|
43 |
+
|
44 |
+
from datasets import concatenate_datasets
|
45 |
+
from cpt_base_datasets import cpt_base_datasets
|
46 |
+
from cpt_instruct_datasets import cpt_instruct_datasets
|
47 |
+
from unsloth_utils import load_text_dataset, load_chat_dataset
|
48 |
+
|
49 |
+
core_datasets = []
|
50 |
+
|
51 |
+
for dataset_config in cpt_base_datasets:
|
52 |
+
dataset = load_text_dataset(tokenizer, **dataset_config)
|
53 |
+
print(f'{dataset=}')
|
54 |
+
core_datasets.append(dataset)
|
55 |
+
|
56 |
+
# for dataset_config in cpt_instruct_datasets:
|
57 |
+
# dataset = load_chat_dataset(tokenizer, **dataset_config)
|
58 |
+
# print(f'{dataset=}')
|
59 |
+
# core_datasets.append(dataset)
|
60 |
+
|
61 |
+
final_dataset = concatenate_datasets(core_datasets)
|
62 |
+
print(f'{final_dataset=}')
|
63 |
+
|
64 |
+
|
65 |
+
from trl import SFTTrainer
|
66 |
+
from transformers import TrainingArguments
|
67 |
+
from unsloth import is_bfloat16_supported
|
68 |
+
from unsloth import UnslothTrainer, UnslothTrainingArguments
|
69 |
+
|
70 |
+
|
71 |
+
trainer = UnslothTrainer(
|
72 |
+
model=model,
|
73 |
+
tokenizer=tokenizer,
|
74 |
+
train_dataset=final_dataset,
|
75 |
+
dataset_text_field='text',
|
76 |
+
max_seq_length=max_seq_length,
|
77 |
+
dataset_num_proc=32,
|
78 |
+
|
79 |
+
args = UnslothTrainingArguments(
|
80 |
+
per_device_train_batch_size=8,
|
81 |
+
gradient_accumulation_steps=8,
|
82 |
+
|
83 |
+
warmup_ratio=0.1,
|
84 |
+
num_train_epochs=1,
|
85 |
+
|
86 |
+
learning_rate=5e-5,
|
87 |
+
embedding_learning_rate=5e-6,
|
88 |
+
|
89 |
+
fp16=not is_bfloat16_supported(),
|
90 |
+
bf16=is_bfloat16_supported(),
|
91 |
+
logging_steps=1,
|
92 |
+
optim='adamw_8bit',
|
93 |
+
weight_decay=0.01,
|
94 |
+
lr_scheduler_type='cosine',
|
95 |
+
seed=23,
|
96 |
+
output_dir=output_dir,
|
97 |
+
report_to='wandb',
|
98 |
+
),
|
99 |
+
)
|
100 |
+
|
101 |
+
trainer_stats = trainer.train()
|
scripts/backup/cpt_instruct_datasets.py
ADDED
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
|
3 |
+
|
4 |
+
roles_map = {
|
5 |
+
'system': 'system',
|
6 |
+
'user': 'user',
|
7 |
+
'human': 'user',
|
8 |
+
'assistant': 'assistant',
|
9 |
+
'gpt': 'assistant',
|
10 |
+
'AI': 'assistant',
|
11 |
+
}
|
12 |
+
|
13 |
+
|
14 |
+
cpt_instruct_datasets = [
|
15 |
+
#
|
16 |
+
# general instructs
|
17 |
+
#
|
18 |
+
# 1.48 GB, 1,420,909
|
19 |
+
# mlabonne/open-perfectblend
|
20 |
+
# meta-math/MetaMathQA 395,000
|
21 |
+
# openbmb/UltraInteract_sft 288,579
|
22 |
+
# HuggingFaceH4/ultrachat_200k 207,865
|
23 |
+
# microsoft/orca-math-word-problems-200k 200,035
|
24 |
+
# HuggingFaceH4/ultrafeedback_binarized 187,405
|
25 |
+
# theblackcat102/evol-codealpaca-v1 111,272
|
26 |
+
# Post-training-Data-Flywheel/AutoIF-instruct-61k 61,492
|
27 |
+
# mlabonne/lmsys-arena-human-preference-55k-sharegpt 57,362
|
28 |
+
{'kind': 'instruct', 'path': 'mlabonne/open-perfectblend', 'split': 'train', 'field': 'conversations', 'transform': lambda msgs: [
|
29 |
+
{'role': roles_map[m['from']], 'content': m['value']}
|
30 |
+
for m in msgs
|
31 |
+
]},
|
32 |
+
|
33 |
+
# 1.41 GB, 939,343
|
34 |
+
# allenai/tulu-3-sft-mixture
|
35 |
+
# CoCoNot (ODC-BY-1.0), 10,983 prompts (Brahman et al., 2024)
|
36 |
+
# FLAN v2 via ai2-adapt-dev/flan_v2_converted, 89,982 prompts (Longpre et al., 2023)
|
37 |
+
# No Robots (CC-BY-NC-4.0), 9,500 prompts (Rajani et al. 2023)
|
38 |
+
# OpenAssistant Guanaco (Apache 2.0), 7,132 prompts (Kopf et al., 2024)
|
39 |
+
# Tulu 3 Persona MATH (ODC-BY-1.0), 149,960 prompts
|
40 |
+
# Tulu 3 Persona GSM (ODC-BY-1.0), 49,980 prompts
|
41 |
+
# Tulu 3 Persona Python (ODC-BY-1.0), 34,999 prompts
|
42 |
+
# Tulu 3 Persona Algebra (ODC-BY-1.0), 20,000 prompts
|
43 |
+
# Tulu 3 Persona IF (ODC-BY-1.0), 29,980 prompts
|
44 |
+
# NuminaMath-TIR (Apache 2.0), 64,312 prompts (Beeching et al. 2024)
|
45 |
+
# Tulu 3 WildGuardMix (Apache 2.0), 50,000 prompts (Han et al., 2024)
|
46 |
+
# Tulu 3 WildJailbreak (ODC-BY-1.0), 50,000 prompts (Wildteaming, 2024)
|
47 |
+
# Tulu 3 Hardcoded (CC-BY-4.0), 240 prompts
|
48 |
+
# Aya (Apache 2.0), 100,000 prompts (Singh et al., 2024)
|
49 |
+
# WildChat GPT-4 (ODC-BY-1.0), 100,000 prompts (Zhao et al., 2024)
|
50 |
+
# TableGPT (MIT), 5,000 prompts (Zha et al., 2023)
|
51 |
+
# SciRIFF (ODC-BY-1.0), 10,000 prompts (Wadden et al., 2024)
|
52 |
+
# Evol CodeAlpaca (Apache 2.0), 107,276 prompts (Luo et al., 2023)
|
53 |
+
{'kind': 'instruct', 'path': 'allenai/tulu-3-sft-mixture', 'split': 'train', 'field': 'messages'},
|
54 |
+
|
55 |
+
#
|
56 |
+
# multilingual instructs
|
57 |
+
#
|
58 |
+
# 2.48 GB, 5,808,694
|
59 |
+
# rombodawg/Everything_Instruct_Multilingual
|
60 |
+
# Science:
|
61 |
+
# antiven0m/physical-reasoning-dpoScience
|
62 |
+
# LawalAfeez/science-dataset
|
63 |
+
# Social media:
|
64 |
+
# Kyle1668/AG-Tweets
|
65 |
+
# euclaise/reddit-instruct-curated
|
66 |
+
# General Knowledge:
|
67 |
+
# NousResearch/CharacterCodex_Characters
|
68 |
+
# jstet/quotes-500k_Famous_Quotes
|
69 |
+
# FronkonGames/steam-games-dataset_Video_Games
|
70 |
+
# totuta_youtube_subs_howto100M_HowTo
|
71 |
+
# Multi-lingual:
|
72 |
+
# Amani27/massive_translation_dataset
|
73 |
+
# udmurtNLP/udmurt-russian-english-labse
|
74 |
+
# grosenthal/latin_english
|
75 |
+
# msarmi9/korean-english-multitarget-ted-talks-task
|
76 |
+
# HaiderSultanArc/MT-Urdu-English_Translate
|
77 |
+
# Garsa3112/ChineseEnglishTranslationDataset
|
78 |
+
# Cooking:
|
79 |
+
# andrewsiah/se_cooking_preference_sft
|
80 |
+
# Hieu-Phamkaggle/food_recipes
|
81 |
+
# Writing:
|
82 |
+
# shahules786/PoetryFoundationData
|
83 |
+
# euclaise/writingprompts
|
84 |
+
# qwedsacf/ivypanda-essaysEssay
|
85 |
+
# Medicine:
|
86 |
+
# keivalya/MedQuad-MedicalQnADataset
|
87 |
+
# nuvocare/MSD
|
88 |
+
# History:
|
89 |
+
# ambrosfitz10k/history_data_v4
|
90 |
+
# Law:
|
91 |
+
# dzunggg/legal-qa-v1
|
92 |
+
# Role-Play:
|
93 |
+
# roleplay4/fun_CoupleRP
|
94 |
+
# Undi95andrijdavid/roleplay-conversation-sharegpt
|
95 |
+
# News:
|
96 |
+
# RealTimeData/bbc_news_alltime
|
97 |
+
# Coding: (rombodawg/code_bagel)
|
98 |
+
# layoric/tiny-codes-alpaca
|
99 |
+
# glaiveai/glaive-code-assistant-v3
|
100 |
+
# ajibawa-2023/Code-290k-ShareGPT
|
101 |
+
# chargoddard/commitpack-ft-instruct-rated
|
102 |
+
# iamtarun/code_instructions_120k_alpaca
|
103 |
+
# ise-uiuc/Magicoder-Evol-Instruct-110K
|
104 |
+
# cognitivecomputations/dolphin-coder
|
105 |
+
# nickrosh/Evol-Instruct-Code-80k-v1
|
106 |
+
# coseal/CodeUltraFeedback_binarized
|
107 |
+
# CyberNative/Code_Vulnerability_Security_DPO
|
108 |
+
# Math: (rombodawg/code_bagel)
|
109 |
+
# TIGER-Lab/MathInstruct
|
110 |
+
# Function calling: (rombodawg/code_bagel)
|
111 |
+
# glaiveai/glaive-function-calling-v2
|
112 |
+
# General Instruct: (rombodawg/OpenHermes-2.5-Uncensored)
|
113 |
+
# teknium/OpenHermes-2.5
|
114 |
+
{'kind': 'instruct', 'path': 'rombodawg/Everything_Instruct_Multilingual', 'split': 'train', 'transform': lambda r: [
|
115 |
+
{'role': 'system', 'content': r['instruction']},
|
116 |
+
{'role': 'user', 'content': r['input']},
|
117 |
+
{'role': 'assistant', 'content': r['output']},
|
118 |
+
]},
|
119 |
+
]
|
scripts/backup/merge-core-into-base.yaml
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
slices:
|
2 |
+
# 1
|
3 |
+
- sources:
|
4 |
+
- model: ../out/pretrain-core-converted/
|
5 |
+
layer_range: [0, 1]
|
6 |
+
# 2
|
7 |
+
- sources:
|
8 |
+
- model: ../out/pretrain-core-converted/
|
9 |
+
layer_range: [0, 1]
|
10 |
+
# 3
|
11 |
+
- sources:
|
12 |
+
- model: ../out/pretrain-core-converted/
|
13 |
+
layer_range: [0, 1]
|
14 |
+
# 4
|
15 |
+
- sources:
|
16 |
+
- model: ../out/pretrain-core-converted/
|
17 |
+
layer_range: [0, 1]
|
18 |
+
# 5
|
19 |
+
- sources:
|
20 |
+
- model: ../out/pretrain-core-converted/
|
21 |
+
layer_range: [0, 1]
|
22 |
+
# 6
|
23 |
+
- sources:
|
24 |
+
- model: ../out/pretrain-core-converted/
|
25 |
+
layer_range: [0, 1]
|
26 |
+
# 7
|
27 |
+
- sources:
|
28 |
+
- model: ../out/pretrain-core-converted/
|
29 |
+
layer_range: [0, 1]
|
30 |
+
# 8
|
31 |
+
- sources:
|
32 |
+
- model: ../out/pretrain-core-converted/
|
33 |
+
layer_range: [0, 1]
|
34 |
+
# 9
|
35 |
+
- sources:
|
36 |
+
- model: ../out/pretrain-core-converted/
|
37 |
+
layer_range: [0, 1]
|
38 |
+
# 10
|
39 |
+
- sources:
|
40 |
+
- model: ../out/pretrain-core-converted/
|
41 |
+
layer_range: [0, 1]
|
42 |
+
# 11
|
43 |
+
- sources:
|
44 |
+
- model: ../out/pretrain-core-converted/
|
45 |
+
layer_range: [0, 1]
|
46 |
+
# 12
|
47 |
+
- sources:
|
48 |
+
- model: ../out/pretrain-core-converted/
|
49 |
+
layer_range: [0, 1]
|
50 |
+
# 13
|
51 |
+
- sources:
|
52 |
+
- model: ../out/pretrain-core-converted/
|
53 |
+
layer_range: [0, 1]
|
54 |
+
# 14
|
55 |
+
- sources:
|
56 |
+
- model: ../out/pretrain-core-converted/
|
57 |
+
layer_range: [0, 1]
|
58 |
+
# 15
|
59 |
+
- sources:
|
60 |
+
- model: ../out/pretrain-core-converted/
|
61 |
+
layer_range: [0, 1]
|
62 |
+
# 16
|
63 |
+
- sources:
|
64 |
+
- model: ../out/pretrain-core-converted/
|
65 |
+
layer_range: [0, 1]
|
66 |
+
# 17
|
67 |
+
- sources:
|
68 |
+
- model: ../out/pretrain-core-converted/
|
69 |
+
layer_range: [0, 1]
|
70 |
+
# 18
|
71 |
+
- sources:
|
72 |
+
- model: ../out/pretrain-core-converted/
|
73 |
+
layer_range: [0, 1]
|
74 |
+
# 19
|
75 |
+
- sources:
|
76 |
+
- model: ../out/pretrain-core-converted/
|
77 |
+
layer_range: [0, 1]
|
78 |
+
# 20
|
79 |
+
- sources:
|
80 |
+
- model: ../out/pretrain-core-converted/
|
81 |
+
layer_range: [0, 1]
|
82 |
+
# 21
|
83 |
+
- sources:
|
84 |
+
- model: ../out/pretrain-core-converted/
|
85 |
+
layer_range: [0, 1]
|
86 |
+
# 22
|
87 |
+
- sources:
|
88 |
+
- model: ../out/pretrain-core-converted/
|
89 |
+
layer_range: [0, 1]
|
90 |
+
# 23
|
91 |
+
- sources:
|
92 |
+
- model: ../out/pretrain-core-converted/
|
93 |
+
layer_range: [0, 1]
|
94 |
+
# 24
|
95 |
+
- sources:
|
96 |
+
- model: ../out/pretrain-core-converted/
|
97 |
+
layer_range: [0, 1]
|
98 |
+
|
99 |
+
merge_method: passthrough
|
100 |
+
dtype: bfloat16
|
scripts/backup/prepare_pretrain_base_datasets.py
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from functools import partial
|
2 |
+
|
3 |
+
from litgpt.tokenizer import Tokenizer
|
4 |
+
from litdata import optimize, TokensLoader, StreamingDataset
|
5 |
+
from transformers import AutoTokenizer
|
6 |
+
|
7 |
+
from utils import tokenize_fn
|
8 |
+
from pretrain_base_datasets import pretrain_base_datasets
|
9 |
+
from pretrain_instruct_datasets import pretrain_instruct_datasets
|
10 |
+
from pretrain_reflection_datasets import pretrain_reflection_datasets
|
11 |
+
from pretrain_reasoning_datasets import pretrain_reasoning_datasets
|
12 |
+
|
13 |
+
|
14 |
+
#
|
15 |
+
# optimize datasets
|
16 |
+
#
|
17 |
+
for i, (block_size, subchunk_size) in enumerate([(4097, 4000)]):
|
18 |
+
chunk_size = block_size * subchunk_size
|
19 |
+
output_dir = f'../pretrain-base-data-{i}-{block_size}-{subchunk_size}'
|
20 |
+
|
21 |
+
outputs = optimize(
|
22 |
+
fn=partial(
|
23 |
+
tokenize_fn,
|
24 |
+
hf_tokenizer=AutoTokenizer.from_pretrained('..', trust_remote_code=True, use_fast=True),
|
25 |
+
tokenizer=Tokenizer('..'),
|
26 |
+
),
|
27 |
+
inputs=(
|
28 |
+
pretrain_base_datasets +
|
29 |
+
pretrain_instruct_datasets +
|
30 |
+
pretrain_reflection_datasets +
|
31 |
+
pretrain_reasoning_datasets
|
32 |
+
),
|
33 |
+
output_dir=output_dir,
|
34 |
+
chunk_size=chunk_size, # Number of tokens to store by chunks. This is roughly 64MB of tokens per chunk.
|
35 |
+
num_workers=32,
|
36 |
+
reorder_files=False,
|
37 |
+
## This is important to inform LitData that we are encoding contiguous 1D array (tokens).
|
38 |
+
## LitData skips storing metadata for each sample e.g all the tokens are concatenated to form one large tensor.
|
39 |
+
# item_loader=TokensLoader(block_size=block_size),
|
40 |
+
)
|
41 |
+
|
42 |
+
#
|
43 |
+
# total number of chunks in datasets
|
44 |
+
#
|
45 |
+
for i, (block_size, subchunk_size) in enumerate([(4097, 4000)]):
|
46 |
+
chunk_size = block_size * subchunk_size
|
47 |
+
input_dir = f'../pretrain-base-data-{i}-{block_size}-{subchunk_size}'
|
48 |
+
|
49 |
+
dataset = StreamingDataset(
|
50 |
+
input_dir=input_dir,
|
51 |
+
item_loader=TokensLoader(block_size=block_size),
|
52 |
+
)
|
53 |
+
|
54 |
+
print(f'{i=}, {block_size=}, {chunk_size=}, {len(dataset)=}, {len(dataset) * block_size=}')
|
55 |
+
|
56 |
+
# total_tokens = sum(len(data) for data in dataset)
|
57 |
+
# print(f'Total number of tokens in the optimized dataset {input_dir!r} is {total_tokens}')
|
58 |
+
total_tokens = len(dataset) * block_size
|
59 |
+
print(f'Total number of tokens in the optimized dataset {input_dir!r} is {total_tokens}')
|
scripts/backup/pretrain_base_datasets.py
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
pretrain_base_datasets = [
|
2 |
+
#
|
3 |
+
# multilingual
|
4 |
+
#
|
5 |
+
# 3.17 GB, 2,226,907
|
6 |
+
*[
|
7 |
+
{'kind': 'base', 'path': 'ontocord/fineweb-permissive-multilingual-2m', 'split': f'train[{i}%:{i + 10}%]', 'format': lambda n: n['text']}
|
8 |
+
for i in range(0, 100, 10)
|
9 |
+
],
|
10 |
+
# 1.64 GB, 1,001,000
|
11 |
+
*[
|
12 |
+
{'kind': 'base', 'path': 'distily/c4_multilingual_1M', 'split': f'train[{i}%:{i + 10}%]', 'format': lambda n: n['text']}
|
13 |
+
for i in range(0, 100, 10)
|
14 |
+
],
|
15 |
+
# 3.8 GB, 19,454,996
|
16 |
+
*[
|
17 |
+
{'kind': 'base', 'path': 'sentence-transformers/parallel-sentences-wikimatrix', 'data_dir': 'all', 'split': f'train[{i}%:{i + 10}%]', 'format': lambda n: n['non_english']}
|
18 |
+
for i in range(0, 100, 10)
|
19 |
+
],
|
20 |
+
|
21 |
+
#
|
22 |
+
# general knowledge
|
23 |
+
#
|
24 |
+
# 65.1 MB, 7,819
|
25 |
+
{'kind': 'base', 'path': 'Sketched33/Cities_Wikipedia_Information', 'format': lambda n: n['wikipedia_content']},
|
26 |
+
# 135 MB, 1,795
|
27 |
+
{'kind': 'base', 'path': 'open-phi/textbooks', 'format': lambda n: n['markdown']},
|
28 |
+
# 631 MB, 111,048
|
29 |
+
{'kind': 'base', 'path': 'open-phi/programming_books_llama', 'format': lambda n: n['markdown']},
|
30 |
+
|
31 |
+
#
|
32 |
+
# misc
|
33 |
+
#
|
34 |
+
# 472 KB, 5,034
|
35 |
+
{'kind': 'base', 'path': 'badrex/llm-emoji-dataset', 'format': '{short description}. {LLM description}. {character}'},
|
36 |
+
|
37 |
+
#
|
38 |
+
# math
|
39 |
+
#
|
40 |
+
# 12.6 GB, 14M rows
|
41 |
+
*[
|
42 |
+
{'kind': 'base', 'path': 'nvidia/OpenMathInstruct-2', 'split': f'train[{i}%:{i + 10}%]', 'format': '{problem} {generated_solution} {expected_answer}'}
|
43 |
+
for i in range(0, 100, 10)
|
44 |
+
],
|
45 |
+
|
46 |
+
#
|
47 |
+
# stem
|
48 |
+
#
|
49 |
+
# 1.44 GB, 63,357
|
50 |
+
*[
|
51 |
+
{'kind': 'base', 'path': 'neuralwork/arxiver', 'split': f'train[{i}%:{i + 10}%]', 'format': lambda n: n['abstract']}
|
52 |
+
for i in range(0, 100, 10)
|
53 |
+
],
|
54 |
+
*[
|
55 |
+
{'kind': 'base', 'path': 'neuralwork/arxiver', 'split': f'train[{i}%:{i + 10}%]', 'format': lambda n: n['markdown']}
|
56 |
+
for i in range(0, 100, 10)
|
57 |
+
],
|
58 |
+
|
59 |
+
#
|
60 |
+
# code
|
61 |
+
#
|
62 |
+
# 7.81 GB, ~2,804,025
|
63 |
+
*[
|
64 |
+
{'kind': 'base', 'path': 'rombodawg/code_bagel_hermes-2.5', 'split': f'train[{i}%:{i + 10}%]', 'format': '{input} {output}'}
|
65 |
+
for i in range(0, 100, 10)
|
66 |
+
],
|
67 |
+
|
68 |
+
#
|
69 |
+
# multilingual
|
70 |
+
#
|
71 |
+
# 742 MB, 321,697
|
72 |
+
*[
|
73 |
+
{'kind': 'base', 'path': 'data-silence/sumnews', 'split': split, 'format': lambda n: n[field]}
|
74 |
+
for split in ['train', 'test']
|
75 |
+
for field in ['title', 'resume', 'news']
|
76 |
+
],
|
77 |
+
# 193 MB, 1,141,967
|
78 |
+
*[
|
79 |
+
{'kind': 'base', 'path': 'xu-song/cc100-samples', 'name': name, 'split': 'train', 'format': lambda n: n['text']}
|
80 |
+
for name in [
|
81 |
+
'am', 'ar', 'as', 'az', 'be', 'bg', 'bn', 'bn_rom', 'br',
|
82 |
+
'bs', 'ca', 'cs', 'cy', 'da', 'de', 'el', 'en', 'eo', 'es',
|
83 |
+
'et', 'eu', 'fa', 'ff', 'fi', 'fr', 'fy', 'ga', 'gd', 'gl',
|
84 |
+
'gn', 'gu', 'ha', 'he', 'hi', 'hi_rom', 'hr', 'ht', 'hu',
|
85 |
+
'hy', 'id', 'ig', 'is', 'it', 'ja', 'jv', 'ka', 'kk', 'km',
|
86 |
+
'kn', 'ko', 'ku', 'ky', 'la', 'lg', 'li', 'ln', 'lo', 'lt',
|
87 |
+
'lv', 'mg', 'mk', 'ml', 'mn', 'mr', 'ms', 'my', 'my_zaw',
|
88 |
+
'ne', 'nl', 'no', 'ns', 'om', 'or', 'pa', 'pl', 'ps', 'pt',
|
89 |
+
'qu', 'rm', 'ro', 'ru', 'sa', 'si', 'sc', 'sd', 'sk', 'sl',
|
90 |
+
'so', 'sq', 'sr', 'ss', 'su', 'sv', 'sw', 'ta', 'ta_rom',
|
91 |
+
'te', 'te_rom', 'th', 'tl', 'tn', 'tr', 'ug', 'uk', 'ur',
|
92 |
+
'ur_rom', 'uz', 'vi', 'wo', 'xh', 'yi', 'yo',
|
93 |
+
'zh-Hans', 'zh-Hant', 'zu',
|
94 |
+
]
|
95 |
+
],
|
96 |
+
|
97 |
+
#
|
98 |
+
# general knowledge
|
99 |
+
#
|
100 |
+
# 3.18 GB, 1,010,500 - uncompressed 6GB
|
101 |
+
*[
|
102 |
+
{'kind': 'base', 'path': 'JeanKaddour/minipile', 'split': f'train[{i}%:{i + 10}%]', 'format': lambda n: n['text']}
|
103 |
+
for i in range(0, 100, 10)
|
104 |
+
],
|
105 |
+
{'kind': 'base', 'path': 'JeanKaddour/minipile', 'split': 'validation', 'format': lambda n: n['text']},
|
106 |
+
{'kind': 'base', 'path': 'JeanKaddour/minipile', 'split': 'test', 'format': lambda n: n['text']},
|
107 |
+
]
|
scripts/backup/pretrain_instruct_datasets.py
ADDED
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
|
3 |
+
|
4 |
+
roles_map = {
|
5 |
+
'system': 'system',
|
6 |
+
'user': 'user',
|
7 |
+
'human': 'user',
|
8 |
+
'assistant': 'assistant',
|
9 |
+
'gpt': 'assistant',
|
10 |
+
'AI': 'assistant',
|
11 |
+
}
|
12 |
+
|
13 |
+
|
14 |
+
pretrain_instruct_datasets = [
|
15 |
+
#
|
16 |
+
# general instructs
|
17 |
+
#
|
18 |
+
# 138 MB, 205,568
|
19 |
+
{'kind': 'instruct', 'path': 'CohereForAI/aya_dataset', 'transform': lambda r: [
|
20 |
+
{'role': 'user', 'content': r['inputs']},
|
21 |
+
{'role': 'assistant', 'content': r['targets']},
|
22 |
+
]},
|
23 |
+
|
24 |
+
# ~3 GB, 4,976,850
|
25 |
+
*[
|
26 |
+
{'kind': 'instruct', 'path': 'saillab/taco-datasets', 'data_dir': name, 'split': 'train', 'transform': lambda r: [
|
27 |
+
{'role': 'system', 'content': r['instruction']},
|
28 |
+
{'role': 'user', 'content': r['input']},
|
29 |
+
{'role': 'assistant', 'content': r['output']},
|
30 |
+
]}
|
31 |
+
for name in [
|
32 |
+
'multilingual-instruction-tuning-dataset /multilingual-alpaca-52k-gpt-4',
|
33 |
+
'multilingual-instruction-tuning-dataset /multilinugal-dolly-15k',
|
34 |
+
]
|
35 |
+
],
|
36 |
+
|
37 |
+
# 1.48 GB, 1,420,909
|
38 |
+
# mlabonne/open-perfectblend
|
39 |
+
# meta-math/MetaMathQA 395,000
|
40 |
+
# openbmb/UltraInteract_sft 288,579
|
41 |
+
# HuggingFaceH4/ultrachat_200k 207,865
|
42 |
+
# microsoft/orca-math-word-problems-200k 200,035
|
43 |
+
# HuggingFaceH4/ultrafeedback_binarized 187,405
|
44 |
+
# theblackcat102/evol-codealpaca-v1 111,272
|
45 |
+
# Post-training-Data-Flywheel/AutoIF-instruct-61k 61,492
|
46 |
+
# mlabonne/lmsys-arena-human-preference-55k-sharegpt 57,362
|
47 |
+
*[
|
48 |
+
{'kind': 'instruct', 'path': 'mlabonne/open-perfectblend', 'split': f'train[{i}%:{i + 10}%]', 'field': 'conversations', 'transform': lambda msgs: [
|
49 |
+
{'role': roles_map[m['from']], 'content': m['value']}
|
50 |
+
for m in msgs
|
51 |
+
]}
|
52 |
+
for i in range(0, 100, 10)
|
53 |
+
],
|
54 |
+
# 4.58 GB, 1,752,473
|
55 |
+
# arcee-ai/The-Tome
|
56 |
+
# - arcee-ai/infini-instruct-top-500k (BAAI/Infinity-Instruct)
|
57 |
+
# - TIGER-Lab/WebInstructSub (top-500k) - IGNORE
|
58 |
+
# - jondurbin/airoboros-3.2
|
59 |
+
# - gardner/glaive-function-calling-v2-sharegpt
|
60 |
+
# - arcee-ai/reasoning-sharegpt (SkunkworksAI/reasoning-0.01)
|
61 |
+
# - arcee-ai/self-instruct-sharegpt (bigcode/self-oss-instruct-sc2-exec-filter-50k)
|
62 |
+
# - cognitivecomputations/ultrainteract_trajectories_sharegpt
|
63 |
+
# - cognitivecomputations/SystemChat-2.0
|
64 |
+
# - arcee-ai/qwen2-72b-magpie-en
|
65 |
+
*[
|
66 |
+
{'kind': 'instruct', 'path': 'arcee-ai/The-Tome', 'split': f'train[{i}%:{i + 10}%]', 'field': 'conversations', 'transform': lambda msgs: [
|
67 |
+
{'role': roles_map[m['from']], 'content': m['value']}
|
68 |
+
for m in msgs
|
69 |
+
]}
|
70 |
+
for i in range(0, 100, 10)
|
71 |
+
],
|
72 |
+
# 2.48 GB, 5,808,694
|
73 |
+
# rombodawg/Everything_Instruct_Multilingual
|
74 |
+
# Science:
|
75 |
+
# antiven0m/physical-reasoning-dpoScience
|
76 |
+
# LawalAfeez/science-dataset
|
77 |
+
# Social media:
|
78 |
+
# Kyle1668/AG-Tweets
|
79 |
+
# euclaise/reddit-instruct-curated
|
80 |
+
# General Knowledge:
|
81 |
+
# NousResearch/CharacterCodex_Characters
|
82 |
+
# jstet/quotes-500k_Famous_Quotes
|
83 |
+
# FronkonGames/steam-games-dataset_Video_Games
|
84 |
+
# totuta_youtube_subs_howto100M_HowTo
|
85 |
+
# Multi-lingual:
|
86 |
+
# Amani27/massive_translation_dataset
|
87 |
+
# udmurtNLP/udmurt-russian-english-labse
|
88 |
+
# grosenthal/latin_english
|
89 |
+
# msarmi9/korean-english-multitarget-ted-talks-task
|
90 |
+
# HaiderSultanArc/MT-Urdu-English_Translate
|
91 |
+
# Garsa3112/ChineseEnglishTranslationDataset
|
92 |
+
# Cooking:
|
93 |
+
# andrewsiah/se_cooking_preference_sft
|
94 |
+
# Hieu-Phamkaggle/food_recipes
|
95 |
+
# Writing:
|
96 |
+
# shahules786/PoetryFoundationData
|
97 |
+
# euclaise/writingprompts
|
98 |
+
# qwedsacf/ivypanda-essaysEssay
|
99 |
+
# Medicine:
|
100 |
+
# keivalya/MedQuad-MedicalQnADataset
|
101 |
+
# nuvocare/MSD
|
102 |
+
# History:
|
103 |
+
# ambrosfitz10k/history_data_v4
|
104 |
+
# Law:
|
105 |
+
# dzunggg/legal-qa-v1
|
106 |
+
# Role-Play:
|
107 |
+
# roleplay4/fun_CoupleRP
|
108 |
+
# Undi95andrijdavid/roleplay-conversation-sharegpt
|
109 |
+
# News:
|
110 |
+
# RealTimeData/bbc_news_alltime
|
111 |
+
# Coding: (rombodawg/code_bagel)
|
112 |
+
# layoric/tiny-codes-alpaca
|
113 |
+
# glaiveai/glaive-code-assistant-v3
|
114 |
+
# ajibawa-2023/Code-290k-ShareGPT
|
115 |
+
# chargoddard/commitpack-ft-instruct-rated
|
116 |
+
# iamtarun/code_instructions_120k_alpaca
|
117 |
+
# ise-uiuc/Magicoder-Evol-Instruct-110K
|
118 |
+
# cognitivecomputations/dolphin-coder
|
119 |
+
# nickrosh/Evol-Instruct-Code-80k-v1
|
120 |
+
# coseal/CodeUltraFeedback_binarized
|
121 |
+
# CyberNative/Code_Vulnerability_Security_DPO
|
122 |
+
# Math: (rombodawg/code_bagel)
|
123 |
+
# TIGER-Lab/MathInstruct
|
124 |
+
# Function calling: (rombodawg/code_bagel)
|
125 |
+
# glaiveai/glaive-function-calling-v2
|
126 |
+
# General Instruct: (rombodawg/OpenHermes-2.5-Uncensored)
|
127 |
+
# teknium/OpenHermes-2.5
|
128 |
+
*[
|
129 |
+
{'kind': 'instruct', 'path': 'rombodawg/Everything_Instruct_Multilingual', 'split': f'train[{i}%:{i + 10}%]', 'transform': lambda r: [
|
130 |
+
{'role': 'system', 'content': r['instruction']},
|
131 |
+
{'role': 'user', 'content': r['input']},
|
132 |
+
{'role': 'assistant', 'content': r['output']},
|
133 |
+
]}
|
134 |
+
for i in range(0, 100, 10)
|
135 |
+
],
|
136 |
+
# 1.41 GB, 939,343
|
137 |
+
# allenai/tulu-3-sft-mixture
|
138 |
+
# CoCoNot (ODC-BY-1.0), 10,983 prompts (Brahman et al., 2024)
|
139 |
+
# FLAN v2 via ai2-adapt-dev/flan_v2_converted, 89,982 prompts (Longpre et al., 2023)
|
140 |
+
# No Robots (CC-BY-NC-4.0), 9,500 prompts (Rajani et al. 2023)
|
141 |
+
# OpenAssistant Guanaco (Apache 2.0), 7,132 prompts (Kopf et al., 2024)
|
142 |
+
# Tulu 3 Persona MATH (ODC-BY-1.0), 149,960 prompts
|
143 |
+
# Tulu 3 Persona GSM (ODC-BY-1.0), 49,980 prompts
|
144 |
+
# Tulu 3 Persona Python (ODC-BY-1.0), 34,999 prompts
|
145 |
+
# Tulu 3 Persona Algebra (ODC-BY-1.0), 20,000 prompts
|
146 |
+
# Tulu 3 Persona IF (ODC-BY-1.0), 29,980 prompts
|
147 |
+
# NuminaMath-TIR (Apache 2.0), 64,312 prompts (Beeching et al. 2024)
|
148 |
+
# Tulu 3 WildGuardMix (Apache 2.0), 50,000 prompts (Han et al., 2024)
|
149 |
+
# Tulu 3 WildJailbreak (ODC-BY-1.0), 50,000 prompts (Wildteaming, 2024)
|
150 |
+
# Tulu 3 Hardcoded (CC-BY-4.0), 240 prompts
|
151 |
+
# Aya (Apache 2.0), 100,000 prompts (Singh et al., 2024)
|
152 |
+
# WildChat GPT-4 (ODC-BY-1.0), 100,000 prompts (Zhao et al., 2024)
|
153 |
+
# TableGPT (MIT), 5,000 prompts (Zha et al., 2023)
|
154 |
+
# SciRIFF (ODC-BY-1.0), 10,000 prompts (Wadden et al., 2024)
|
155 |
+
# Evol CodeAlpaca (Apache 2.0), 107,276 prompts (Luo et al., 2023)
|
156 |
+
*[
|
157 |
+
{'kind': 'instruct', 'path': 'allenai/tulu-3-sft-mixture', 'split': f'train[{i}%:{i + 10}%]', 'field': 'messages'}
|
158 |
+
for i in range(0, 100, 10)
|
159 |
+
],
|
160 |
+
|
161 |
+
#
|
162 |
+
# tool/function calling
|
163 |
+
#
|
164 |
+
# 65.7 MB, 11,578
|
165 |
+
{'kind': 'instruct', 'path': 'NousResearch/hermes-function-calling-v1', 'field': 'conversations', 'transform': lambda msgs: [
|
166 |
+
{'role': roles_map[m['from']], 'content': m['value']}
|
167 |
+
for m in msgs
|
168 |
+
]},
|
169 |
+
|
170 |
+
#
|
171 |
+
# agent
|
172 |
+
#
|
173 |
+
# 1.51 GB, 485,874
|
174 |
+
*[
|
175 |
+
{'kind': 'instruct', 'path': 'arcee-ai/agent-data', 'split': f'train[{i}%:{i + 10}%]', 'field': 'conversations', 'transform': lambda msgs: [
|
176 |
+
{'role': roles_map[m['from']], 'content': m['value']}
|
177 |
+
for m in msgs
|
178 |
+
]}
|
179 |
+
for i in range(0, 100, 10)
|
180 |
+
],
|
181 |
+
# 2.21 GB, 1,046,410
|
182 |
+
*[
|
183 |
+
{'kind': 'instruct', 'path': 'microsoft/orca-agentinstruct-1M-v1', 'split': split, 'field': 'messages', 'transform': lambda msgs: json.loads(msgs)}
|
184 |
+
for split in [
|
185 |
+
'creative_content', 'text_modification', 'struct2text_flow', 'rc', 'rag',
|
186 |
+
'text_extraction', 'mcq', 'follow_up', 'analytical_reasoning', 'fermi', 'fs_cot_flow',
|
187 |
+
'code_', 'brain_teaser', 'text_classification', 'open_domain_qa',
|
188 |
+
]
|
189 |
+
],
|
190 |
+
|
191 |
+
#
|
192 |
+
# general instructs
|
193 |
+
#
|
194 |
+
# 1.52 GB, 214k (3.98 GB, 814,334)
|
195 |
+
{'kind': 'instruct', 'path': 'cognitivecomputations/dolphin-r1', 'data_files': 'dolphin-r1-nonreasoning.jsonl', 'split': 'train', 'field': 'messages'},
|
196 |
+
# 4.15 GB, 2,197,730
|
197 |
+
{'kind': 'instruct', 'path': 'HuggingFaceTB/smoltalk', 'name': 'all', 'field': 'messages'},
|
198 |
+
]
|
scripts/backup/pretrain_reasoning_datasets.py
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
roles_map = {
|
2 |
+
'system': 'system',
|
3 |
+
'user': 'user',
|
4 |
+
'human': 'user',
|
5 |
+
'assistant': 'assistant',
|
6 |
+
'gpt': 'assistant',
|
7 |
+
'AI': 'assistant',
|
8 |
+
}
|
9 |
+
|
10 |
+
|
11 |
+
pretrain_reasoning_datasets = [
|
12 |
+
#
|
13 |
+
# basic reasoning
|
14 |
+
#
|
15 |
+
# 10.8 MB, 15,770
|
16 |
+
{'kind': 'instruct', 'path': 'AtlasUnified/Atlas-Reasoning', 'data_files': 'reasoning.csv', 'transform': lambda r: [
|
17 |
+
{'role': 'user', 'content': r['Prompt']},
|
18 |
+
{'role': 'assistant', 'content': r['Step-by-step reasoning'] + '\n' + r['Solution']},
|
19 |
+
]},
|
20 |
+
# 1.23 GB, 859,594
|
21 |
+
*[
|
22 |
+
{'kind': 'instruct', 'path': 'AI-MO/NuminaMath-CoT', 'split': f'train[{i}%:{i + 10}%]', 'field': 'messages'}
|
23 |
+
for i in range(0, 100, 10)
|
24 |
+
],
|
25 |
+
# 148 MB, 72,540
|
26 |
+
*[
|
27 |
+
{'kind': 'instruct', 'path': 'AI-MO/NuminaMath-TIR', 'split': f'train[{i}%:{i + 10}%]', 'field': 'messages'}
|
28 |
+
for i in range(0, 100, 10)
|
29 |
+
],
|
30 |
+
|
31 |
+
#
|
32 |
+
# math reasoning
|
33 |
+
#
|
34 |
+
# 1.79 MB, 3,963
|
35 |
+
{'kind': 'instruct', 'path': 'AlgorithmicResearchGroup/math_reasoning_autoformalization_track', 'transform': lambda r: [
|
36 |
+
{'role': 'user', 'content': r['informal_statement']},
|
37 |
+
{'role': 'assistant', 'content': r['informal_proof'] + '\n' + r['formal_proof']},
|
38 |
+
]},
|
39 |
+
# 307 MB, 19,944
|
40 |
+
{'kind': 'instruct', 'path': 'KingNish/reasoning-base-20k', 'transform': lambda r: [
|
41 |
+
{'role': 'user', 'content': r['user']},
|
42 |
+
{'role': 'assistant', 'content': r['reasoning'] + '\n' + r['assistant']},
|
43 |
+
]},
|
44 |
+
# 9.45 MB, 10,000
|
45 |
+
{'kind': 'instruct', 'path': 'Aarushhh/math-reasoning-10k', 'transform': lambda r: [
|
46 |
+
{'role': 'user', 'content': r['problem']},
|
47 |
+
{'role': 'assistant', 'content': r['plan'] + '\n' + r['solution']},
|
48 |
+
]},
|
49 |
+
|
50 |
+
#
|
51 |
+
# cot reasoning
|
52 |
+
#
|
53 |
+
# 11.7 GB, 1,850,809
|
54 |
+
*[
|
55 |
+
{'kind': 'instruct', 'path': 'ServiceNow-AI/R1-Distill-SFT', 'data_dir': 'v0', 'split': f'train[{i}%:{i + 10}%]', 'transform': lambda r: [
|
56 |
+
{'role': 'user', 'content': r['problem']},
|
57 |
+
{'role': 'assistant', 'content': r['reannotated_assistant_content']},
|
58 |
+
]}
|
59 |
+
for i in range(0, 100, 10)
|
60 |
+
],
|
61 |
+
*[
|
62 |
+
{'kind': 'instruct', 'path': 'ServiceNow-AI/R1-Distill-SFT', 'data_dir': 'v1', 'split': f'train[{i}%:{i + 10}%]', 'transform': lambda r: r['reannotated_messages']}
|
63 |
+
for i in range(0, 100, 10)
|
64 |
+
],
|
65 |
+
# 3.85 GB, 300k (3.98 GB, 814,334)
|
66 |
+
*[
|
67 |
+
{'kind': 'instruct', 'path': 'cognitivecomputations/dolphin-r1', 'data_files': 'dolphin-r1-reasoning-deepseek.jsonl', 'split': f'train[{i}%:{i + 10}%]', 'transform': lambda r: [
|
68 |
+
*r['messages'],
|
69 |
+
# {'role': 'assistant', 'content': (('<think>\n' + r['reasoning'] + '\n</think>\n') if r.get('reasoning') else '') + r['answer']},
|
70 |
+
{'role': 'assistant', 'content': (r.get('reasoning') or '') + (r.get('answer') or '')},
|
71 |
+
]}
|
72 |
+
for i in range(0, 100, 10)
|
73 |
+
],
|
74 |
+
# 3.49 GB, 300k (3.98 GB, 814,334)
|
75 |
+
*[
|
76 |
+
{'kind': 'instruct', 'path': 'cognitivecomputations/dolphin-r1', 'data_files': 'dolphin-r1-reasoning-flash.jsonl', 'split': f'train[{i}%:{i + 10}%]', 'transform': lambda r: [
|
77 |
+
*r['messages'],
|
78 |
+
# {'role': 'assistant', 'content': (('<think>\n' + r['reasoning'] + '\n</think>\n') if r.get('reasoning') else '') + r['answer']},
|
79 |
+
{'role': 'assistant', 'content': (r.get('reasoning') or '') + (r.get('answer') or '')},
|
80 |
+
]}
|
81 |
+
for i in range(0, 100, 10)
|
82 |
+
],
|
83 |
+
# 1.08 GB, 113,957
|
84 |
+
{'kind': 'instruct', 'path': 'open-thoughts/OpenThoughts-114k', 'split': 'train', 'field': 'conversations', 'transform': lambda msgs: [
|
85 |
+
{'role': roles_map[m['from']], 'content': m['value']}
|
86 |
+
for m in msgs
|
87 |
+
]},
|
88 |
+
# 384 MB, 77,685
|
89 |
+
{'kind': 'instruct', 'path': 'O1-OPEN/OpenO1-SFT', 'split': 'train', 'transform': lambda r: [
|
90 |
+
{'role': 'user', 'content': r['instruction']},
|
91 |
+
{'role': 'assistant', 'content': r['output']},
|
92 |
+
]},
|
93 |
+
# 6.88 MB, 1,000
|
94 |
+
{'kind': 'instruct', 'path': 'simplescaling/s1K', 'split': 'train', 'transform': lambda r: [
|
95 |
+
{'role': 'user', 'content': r['question']},
|
96 |
+
{'role': 'assistant', 'content': '<think>\n' + '\n'.join(r['thinking_trajectories']) + '\n</think>\n' + r['solution']},
|
97 |
+
]},
|
98 |
+
]
|
scripts/backup/pretrain_reflection_datasets.py
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
roles_map = {
|
2 |
+
'system': 'system',
|
3 |
+
'user': 'user',
|
4 |
+
'human': 'user',
|
5 |
+
'assistant': 'assistant',
|
6 |
+
'gpt': 'assistant',
|
7 |
+
'AI': 'assistant',
|
8 |
+
}
|
9 |
+
|
10 |
+
|
11 |
+
pretrain_reflection_datasets = [
|
12 |
+
#
|
13 |
+
# reflection
|
14 |
+
#
|
15 |
+
# 4.17 MB, 1,000
|
16 |
+
{'kind': 'instruct', 'path': 'dvilasuero/reflection-v1-gpt-4o-judge', 'transform': lambda r: [
|
17 |
+
{'role': 'system', 'content': r['system']},
|
18 |
+
{'role': 'user', 'content': r['prompt']},
|
19 |
+
{'role': 'assistant', 'content': r['response']},
|
20 |
+
]},
|
21 |
+
# 12.4 MB, 3,000
|
22 |
+
{'kind': 'instruct', 'path': 'dvilasuero/reflection-v1-openai-o-mini-judge', 'transform': lambda r: [
|
23 |
+
{'role': 'system', 'content': r['system']},
|
24 |
+
{'role': 'user', 'content': r['prompt']},
|
25 |
+
{'role': 'assistant', 'content': r['response']},
|
26 |
+
]},
|
27 |
+
# 70.8 MB, 36,549
|
28 |
+
{'kind': 'instruct', 'path': 'dvilasuero/reflection-v1-final-dedup', 'transform': lambda r: [
|
29 |
+
{'role': 'system', 'content': r['system']},
|
30 |
+
{'role': 'user', 'content': r['prompt']},
|
31 |
+
{'role': 'assistant', 'content': r['response']},
|
32 |
+
]},
|
33 |
+
# 30.6 MB, 25,391
|
34 |
+
{'kind': 'instruct', 'path': 'flozi00/reflection-qwen2.5-72b-260924', 'transform': lambda r: [
|
35 |
+
r['system'][0],
|
36 |
+
{'role': 'user', 'content': r['input']},
|
37 |
+
{'role': 'assistant', 'content': r['reflection'] + '\n' + r['output']},
|
38 |
+
]},
|
39 |
+
]
|
scripts/backup/unsloth_utils.py
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from typing import Optional, Iterator, Callable, Any
|
2 |
+
|
3 |
+
import torch
|
4 |
+
from datasets import load_dataset, concatenate_datasets
|
5 |
+
from transformers import AutoTokenizer
|
6 |
+
|
7 |
+
|
8 |
+
def load_text_dataset(tokenizer: AutoTokenizer,
|
9 |
+
kind: str,
|
10 |
+
path: str,
|
11 |
+
name: Optional[str]=None,
|
12 |
+
data_dir: Optional[str]=None,
|
13 |
+
data_files: Optional[str]=None,
|
14 |
+
keep_in_memory: bool=False,
|
15 |
+
revision: Optional[str]=None,
|
16 |
+
split: str='train',
|
17 |
+
num_proc: Optional[int]=None,
|
18 |
+
format: Optional[Callable|str]=None) -> Any:
|
19 |
+
assert isinstance(format, str) or callable(format), f'{path=} {format=}'
|
20 |
+
assert kind == 'base'
|
21 |
+
|
22 |
+
dataset = load_dataset(path=path,
|
23 |
+
name=name,
|
24 |
+
data_dir=data_dir,
|
25 |
+
data_files=data_files,
|
26 |
+
keep_in_memory=keep_in_memory,
|
27 |
+
revision=revision,
|
28 |
+
split=split,
|
29 |
+
trust_remote_code=True,
|
30 |
+
num_proc=num_proc)
|
31 |
+
|
32 |
+
EOS_TOKEN = tokenizer.eos_token
|
33 |
+
|
34 |
+
def format_dataset(batch):
|
35 |
+
nonlocal EOS_TOKEN
|
36 |
+
nonlocal format
|
37 |
+
texts: list = []
|
38 |
+
rows = [dict(zip(batch.keys(), values)) for values in zip(*batch.values())]
|
39 |
+
|
40 |
+
if callable(format):
|
41 |
+
for row in rows:
|
42 |
+
# print(f'{row=}')
|
43 |
+
text = format(row)
|
44 |
+
|
45 |
+
if not text:
|
46 |
+
text = '[NONE]'
|
47 |
+
|
48 |
+
text += EOS_TOKEN
|
49 |
+
texts.append(text)
|
50 |
+
else:
|
51 |
+
for row in rows:
|
52 |
+
# print(f'{row=}')
|
53 |
+
text = format.format(**row)
|
54 |
+
|
55 |
+
if not text:
|
56 |
+
text = '[NONE]'
|
57 |
+
|
58 |
+
text += EOS_TOKEN
|
59 |
+
texts.append(text)
|
60 |
+
|
61 |
+
return {'text': texts}
|
62 |
+
|
63 |
+
dataset = dataset.map(format_dataset, batched=True)
|
64 |
+
return dataset
|
65 |
+
|
66 |
+
|
67 |
+
def load_chat_dataset(tokenizer: AutoTokenizer,
|
68 |
+
kind: str,
|
69 |
+
path: str,
|
70 |
+
name: Optional[str]=None,
|
71 |
+
data_dir: Optional[str]=None,
|
72 |
+
data_files: Optional[str]=None,
|
73 |
+
keep_in_memory: bool=False,
|
74 |
+
revision: Optional[str]=None,
|
75 |
+
split: str='train',
|
76 |
+
num_proc: Optional[int]=None,
|
77 |
+
field: Optional[str]=None,
|
78 |
+
transform: Optional[Callable]=None) -> Any:
|
79 |
+
assert kind == 'instruct'
|
80 |
+
|
81 |
+
dataset = load_dataset(path=path,
|
82 |
+
name=name,
|
83 |
+
data_dir=data_dir,
|
84 |
+
data_files=data_files,
|
85 |
+
keep_in_memory=keep_in_memory,
|
86 |
+
revision=revision,
|
87 |
+
split=split,
|
88 |
+
trust_remote_code=True,
|
89 |
+
num_proc=num_proc)
|
90 |
+
|
91 |
+
EOS_TOKEN = tokenizer.eos_token
|
92 |
+
|
93 |
+
def format_dataset(batch):
|
94 |
+
nonlocal EOS_TOKEN
|
95 |
+
nonlocal tokenizer
|
96 |
+
nonlocal field
|
97 |
+
nonlocal transform
|
98 |
+
texts: list = []
|
99 |
+
rows = [dict(zip(batch.keys(), values)) for values in zip(*batch.values())]
|
100 |
+
|
101 |
+
if callable(transform):
|
102 |
+
for row in rows:
|
103 |
+
if field:
|
104 |
+
messages = transform(row[field])
|
105 |
+
else:
|
106 |
+
messages = transform(row)
|
107 |
+
|
108 |
+
text = tokenizer.apply_chat_template(messages, tokenize=False)
|
109 |
+
text += EOS_TOKEN
|
110 |
+
texts.append(text)
|
111 |
+
else:
|
112 |
+
for row in rows:
|
113 |
+
if field:
|
114 |
+
messages = row[field]
|
115 |
+
else:
|
116 |
+
raise ValueError(field)
|
117 |
+
|
118 |
+
text = tokenizer.apply_chat_template(messages, tokenize=False)
|
119 |
+
text += EOS_TOKEN
|
120 |
+
texts.append(text)
|
121 |
+
|
122 |
+
return {'text': texts}
|
123 |
+
|
124 |
+
dataset = dataset.map(format_dataset, batched=True)
|
125 |
+
return dataset
|
scripts/core_base_datasets.py
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
core_base_datasets = [
|
2 |
+
#
|
3 |
+
# multilingual
|
4 |
+
#
|
5 |
+
# 3.17 GB, 2,226,907
|
6 |
+
*[
|
7 |
+
{'kind': 'base', 'path': 'ontocord/fineweb-permissive-multilingual-2m', 'split': f'train[{i}%:{i + 5}%]', 'format': lambda n: n['text']}
|
8 |
+
for i in range(0, 100, 5)
|
9 |
+
],
|
10 |
+
# 1.64 GB, 1,001,000
|
11 |
+
*[
|
12 |
+
{'kind': 'base', 'path': 'distily/c4_multilingual_1M', 'split': f'train[{i}%:{i + 5}%]', 'format': lambda n: n['text']}
|
13 |
+
for i in range(0, 100, 5)
|
14 |
+
],
|
15 |
+
# 742 MB, 321,697
|
16 |
+
*[
|
17 |
+
{'kind': 'base', 'path': 'data-silence/sumnews', 'split': split, 'format': lambda n: n[field]}
|
18 |
+
for split in ['train', 'test']
|
19 |
+
for field in ['title', 'resume', 'news']
|
20 |
+
],
|
21 |
+
# 193 MB, 1,141,967
|
22 |
+
*[
|
23 |
+
{'kind': 'base', 'path': 'xu-song/cc100-samples', 'name': name, 'split': 'train', 'format': lambda n: n['text']}
|
24 |
+
for name in [
|
25 |
+
'am', 'ar', 'as', 'az', 'be', 'bg', 'bn', 'bn_rom', 'br',
|
26 |
+
'bs', 'ca', 'cs', 'cy', 'da', 'de', 'el', 'en', 'eo', 'es',
|
27 |
+
'et', 'eu', 'fa', 'ff', 'fi', 'fr', 'fy', 'ga', 'gd', 'gl',
|
28 |
+
'gn', 'gu', 'ha', 'he', 'hi', 'hi_rom', 'hr', 'ht', 'hu',
|
29 |
+
'hy', 'id', 'ig', 'is', 'it', 'ja', 'jv', 'ka', 'kk', 'km',
|
30 |
+
'kn', 'ko', 'ku', 'ky', 'la', 'lg', 'li', 'ln', 'lo', 'lt',
|
31 |
+
'lv', 'mg', 'mk', 'ml', 'mn', 'mr', 'ms', 'my', 'my_zaw',
|
32 |
+
'ne', 'nl', 'no', 'ns', 'om', 'or', 'pa', 'pl', 'ps', 'pt',
|
33 |
+
'qu', 'rm', 'ro', 'ru', 'sa', 'si', 'sc', 'sd', 'sk', 'sl',
|
34 |
+
'so', 'sq', 'sr', 'ss', 'su', 'sv', 'sw', 'ta', 'ta_rom',
|
35 |
+
'te', 'te_rom', 'th', 'tl', 'tn', 'tr', 'ug', 'uk', 'ur',
|
36 |
+
'ur_rom', 'uz', 'vi', 'wo', 'xh', 'yi', 'yo',
|
37 |
+
'zh-Hans', 'zh-Hant', 'zu',
|
38 |
+
]
|
39 |
+
],
|
40 |
+
|
41 |
+
#
|
42 |
+
# misc
|
43 |
+
#
|
44 |
+
# 472 KB, 5,034
|
45 |
+
{'kind': 'base', 'path': 'badrex/llm-emoji-dataset', 'format': '{short description}. {LLM description}. {character}'},
|
46 |
+
|
47 |
+
#
|
48 |
+
# stem
|
49 |
+
#
|
50 |
+
# 12.2 MB, 500,000
|
51 |
+
{'kind': 'base', 'path': 'fblgit/simple-math', 'revision': 'refs/convert/parquet', 'split': 'train', 'format': '{instruction} = {output}'},
|
52 |
+
{'kind': 'base', 'path': 'fblgit/simple-math', 'revision': 'refs/convert/parquet', 'split': 'test', 'format': '{instruction} = {output}'},
|
53 |
+
# 125 MB, 1,000,000
|
54 |
+
{'kind': 'base', 'path': 'Gusarich/math-expressions-1m', 'revision': 'refs/convert/parquet', 'split': 'train', 'format': '{expression} = {result}'},
|
55 |
+
|
56 |
+
# 1.44 GB, 63,357
|
57 |
+
*[
|
58 |
+
{'kind': 'base', 'path': 'neuralwork/arxiver', 'split': f'train[{i}%:{i + 10}%]', 'format': lambda n: n['abstract']}
|
59 |
+
for i in range(0, 100, 10)
|
60 |
+
],
|
61 |
+
*[
|
62 |
+
{'kind': 'base', 'path': 'neuralwork/arxiver', 'split': f'train[{i}%:{i + 10}%]', 'format': lambda n: n['markdown']}
|
63 |
+
for i in range(0, 100, 10)
|
64 |
+
],
|
65 |
+
|
66 |
+
#
|
67 |
+
# code
|
68 |
+
#
|
69 |
+
# 36.8 MB, 79,013
|
70 |
+
# Rosetta Code currently has 1,203 tasks, 389 draft tasks, and is aware of 883 languages
|
71 |
+
{'kind': 'base', 'path': 'christopher/rosetta-code', 'format': lambda n: n['code']},
|
72 |
+
# 1.62 GB, 1,632,309
|
73 |
+
# Python, TypeScript, JavaScript, Ruby, Julia, Rust, C++, Bash, Java, C#, and Go; SQL, Cypher
|
74 |
+
*[
|
75 |
+
{'kind': 'base', 'path': 'nampdn-ai/tiny-codes', 'split': f'train[{i}%:{i + 10}%]', 'format': '{prompt} {response}'}
|
76 |
+
for i in range(0, 100, 10)
|
77 |
+
],
|
78 |
+
|
79 |
+
#
|
80 |
+
# general knowledge
|
81 |
+
#
|
82 |
+
# 3.18 GB, 1,010,500 - uncompressed 6GB
|
83 |
+
*[
|
84 |
+
{'kind': 'base', 'path': 'JeanKaddour/minipile', 'split': f'train[{i}%:{i + 5}%]', 'format': lambda n: n['text']}
|
85 |
+
for i in range(0, 100, 5)
|
86 |
+
],
|
87 |
+
{'kind': 'base', 'path': 'JeanKaddour/minipile', 'split': 'validation', 'format': lambda n: n['text']},
|
88 |
+
{'kind': 'base', 'path': 'JeanKaddour/minipile', 'split': 'test', 'format': lambda n: n['text']},
|
89 |
+
]
|
scripts/core_instruct_datasets.py
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
roles_map = {
|
2 |
+
'system': 'system',
|
3 |
+
'user': 'user',
|
4 |
+
'human': 'user',
|
5 |
+
'assistant': 'assistant',
|
6 |
+
'gpt': 'assistant',
|
7 |
+
'AI': 'assistant',
|
8 |
+
}
|
9 |
+
|
10 |
+
R1_SYSTEM_PROMPT = '''\
|
11 |
+
You are an AI assistant.
|
12 |
+
|
13 |
+
Your primary directive is to provide well-reasoned, structured, and extensively detailed responses.
|
14 |
+
|
15 |
+
Formatting Requirements:
|
16 |
+
- Always structure your replies using: <think>{reasoning}</think>{answer}
|
17 |
+
- The <think></think> block should contain at least six reasoning steps when applicable.
|
18 |
+
- If the answer requires minimal thought, the <think></think> block may be left empty.
|
19 |
+
- The user does not see the <think></think> section. Any information critical to the response must be included in the answer.
|
20 |
+
- If you notice that you have engaged in circular reasoning or repetition, immediately terminate {reasoning} with a </think> and proceed to the {answer}
|
21 |
+
|
22 |
+
Response Guidelines:
|
23 |
+
- Detailed and Structured: Use rich Markdown formatting for clarity and readability.
|
24 |
+
- Scientific and Logical Approach: Your explanations should reflect the depth and precision of the greatest scientific minds.
|
25 |
+
- Prioritize Reasoning: Always reason through the problem first, unless the answer is trivial.
|
26 |
+
- Concise yet Complete: Ensure responses are informative, yet to the point without unnecessary elaboration.
|
27 |
+
- Maintain a professional, intelligent, and analytical tone in all interactions.'''
|
28 |
+
|
29 |
+
core_instruct_datasets = [
|
30 |
+
# 65.7 MB, 11,578
|
31 |
+
# 1.89k
|
32 |
+
{'kind': 'instruct', 'path': 'NousResearch/hermes-function-calling-v1', 'data_files': 'func-calling-singleturn.json', 'split': 'train', 'field': 'conversations', 'transform': lambda msgs: [
|
33 |
+
{'role': roles_map[m['from']], 'content': m['value']}
|
34 |
+
for m in msgs
|
35 |
+
]},
|
36 |
+
|
37 |
+
# 21.1 MB, 1,000
|
38 |
+
{'kind': 'instruct', 'path': 'simplescaling/s1K-1.1', 'split': 'train', 'transform': lambda r: [
|
39 |
+
{'role': 'system', 'content': R1_SYSTEM_PROMPT},
|
40 |
+
{'role': 'user', 'content': r.get('question') or ''},
|
41 |
+
{'role': 'assistant', 'content': '<think>\n' + (r.get('deepseek_thinking_trajectory') or '') + '\n</think>\n' + (r.get('solution') or '')},
|
42 |
+
]}
|
43 |
+
]
|
scripts/prepare_core_datasets.py
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from functools import partial
|
2 |
+
|
3 |
+
from litgpt.tokenizer import Tokenizer
|
4 |
+
from litdata import optimize, TokensLoader, StreamingDataset
|
5 |
+
from transformers import AutoTokenizer
|
6 |
+
|
7 |
+
from utils import tokenize_fn
|
8 |
+
from core_base_datasets import core_base_datasets
|
9 |
+
from core_instruct_datasets import core_instruct_datasets
|
10 |
+
|
11 |
+
seqs = [
|
12 |
+
(0, 1048576, 2049, 8000),
|
13 |
+
(2049, 8193, 8193, 2000),
|
14 |
+
(8193, 1048576, 32769, 500),
|
15 |
+
]
|
16 |
+
|
17 |
+
#
|
18 |
+
# optimize datasets
|
19 |
+
#
|
20 |
+
for i, (min_len, max_len, block_size, subchunk_size) in enumerate(seqs):
|
21 |
+
chunk_size = block_size * subchunk_size
|
22 |
+
output_dir = f'../core-data-{i}-{min_len}-{max_len}-{block_size}-{subchunk_size}'
|
23 |
+
|
24 |
+
outputs = optimize(
|
25 |
+
fn=partial(
|
26 |
+
tokenize_fn,
|
27 |
+
min_len=min_len,
|
28 |
+
max_len=max_len,
|
29 |
+
hf_tokenizer=AutoTokenizer.from_pretrained('..', trust_remote_code=True, use_fast=True),
|
30 |
+
tokenizer=Tokenizer('..'),
|
31 |
+
),
|
32 |
+
inputs=core_base_datasets + core_instruct_datasets,
|
33 |
+
output_dir=output_dir,
|
34 |
+
chunk_size=chunk_size, # Number of tokens to store by chunks. This is roughly 64MB of tokens per chunk.
|
35 |
+
num_workers=32,
|
36 |
+
reorder_files=False,
|
37 |
+
## This is important to inform LitData that we are encoding contiguous 1D array (tokens).
|
38 |
+
## LitData skips storing metadata for each sample e.g all the tokens are concatenated to form one large tensor.
|
39 |
+
# item_loader=TokensLoader(block_size=block_size),
|
40 |
+
)
|
41 |
+
|
42 |
+
#
|
43 |
+
# total number of chunks in datasets
|
44 |
+
#
|
45 |
+
for i, (min_len, max_len, block_size, subchunk_size) in enumerate(seqs):
|
46 |
+
chunk_size = block_size * subchunk_size
|
47 |
+
input_dir = f'../core-data-{i}-{min_len}-{max_len}-{block_size}-{subchunk_size}'
|
48 |
+
|
49 |
+
dataset = StreamingDataset(
|
50 |
+
input_dir=input_dir,
|
51 |
+
item_loader=TokensLoader(block_size=block_size),
|
52 |
+
)
|
53 |
+
|
54 |
+
print(f'{i=}, {min_len=}, {max_len=}, {block_size=}, {chunk_size=}, {len(dataset)=}, {len(dataset) * block_size=}')
|
55 |
+
|
56 |
+
# total_tokens = sum(len(data) for data in dataset)
|
57 |
+
# print(f'Total number of tokens in the optimized dataset {input_dir!r} is {total_tokens}')
|
58 |
+
total_tokens = len(dataset) * block_size
|
59 |
+
print(f'Total number of tokens in the optimized dataset {input_dir!r} is {total_tokens}')
|
scripts/pretrain-core-model-0.yaml
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# The name of the model to pretrain. Choose from names in ``litgpt.config``. Mutually exclusive with
|
2 |
+
# ``model_config``. (type: Optional[str], default: null)
|
3 |
+
model_name: 'tangled-alpha-0.3-core'
|
4 |
+
|
5 |
+
# A ``litgpt.Config`` object to define the model architecture. Mutually exclusive with
|
6 |
+
# ``model_config``. (type: Optional[Config], default: null)
|
7 |
+
model_config:
|
8 |
+
name: 'tangled-alpha-0.3-core'
|
9 |
+
block_size: 131072
|
10 |
+
vocab_size: 100352
|
11 |
+
padded_vocab_size: 100352
|
12 |
+
n_layer: 32
|
13 |
+
n_head: 4
|
14 |
+
n_embd: 512
|
15 |
+
n_query_groups: 4
|
16 |
+
rotary_percentage: 1.0
|
17 |
+
parallel_residual: False
|
18 |
+
bias: False
|
19 |
+
norm_class_name: "RMSNorm"
|
20 |
+
mlp_class_name: "LLaMAMLP"
|
21 |
+
intermediate_size: 2048 # n_embd * 4
|
22 |
+
norm_eps: 1e-5
|
23 |
+
rope_base: 10000000
|
24 |
+
head_size: 128 # n_embd / n_head
|
25 |
+
|
26 |
+
# Directory in which to save checkpoints and logs. If running in a Lightning Studio Job, look for it in
|
27 |
+
# /teamspace/jobs/<job-name>/share. (type: <class 'Path'>, default: out/pretrain)
|
28 |
+
out_dir: "../out/pretrain-core/"
|
29 |
+
|
30 |
+
# The precision to use for pretraining. Possible choices: "bf16-true", "bf16-mixed", "32-true". (type: Optional[str], default: null)
|
31 |
+
# precision: bf16-mixed
|
32 |
+
precision: bf16-true
|
33 |
+
|
34 |
+
# Optional path to a checkpoint directory to initialize the model from.
|
35 |
+
# Useful for continued pretraining. Mutually exclusive with ``resume``. (type: Optional[Path], default: null)
|
36 |
+
initial_checkpoint_dir:
|
37 |
+
|
38 |
+
# Path to a checkpoint directory to resume from in case training was interrupted, or ``True`` to resume
|
39 |
+
# from the latest checkpoint in ``out_dir``. An error will be raised if no checkpoint is found. Passing
|
40 |
+
# ``'auto'`` will resume from the latest checkpoint but not error if no checkpoint exists.
|
41 |
+
# (type: Union[bool, Literal["auto"], Path], default: False)
|
42 |
+
resume: "auto"
|
43 |
+
|
44 |
+
# Data-related arguments. If not provided, the default is ``litgpt.data.TinyLlama``.
|
45 |
+
data:
|
46 |
+
class_path: LitData
|
47 |
+
|
48 |
+
init_args:
|
49 |
+
data_path: "../core-data-0-8192-2000/"
|
50 |
+
num_workers: 32
|
51 |
+
|
52 |
+
# Training-related arguments. See ``litgpt.args.TrainArgs`` for details
|
53 |
+
train:
|
54 |
+
# Number of optimizer steps between saving checkpoints (type: Optional[int], default: 1000)
|
55 |
+
save_interval: 100
|
56 |
+
|
57 |
+
# Number of iterations between logging calls (type: int, default: 1)
|
58 |
+
log_interval: 1
|
59 |
+
|
60 |
+
# Number of samples between optimizer steps across data-parallel ranks (type: int, default: 512)
|
61 |
+
global_batch_size: 512
|
62 |
+
# global_batch_size: 256
|
63 |
+
|
64 |
+
# Number of samples per data-parallel rank (type: int, default: 4)
|
65 |
+
micro_batch_size: 4
|
66 |
+
# micro_batch_size: 2
|
67 |
+
# micro_batch_size: 1
|
68 |
+
|
69 |
+
# Number of iterations with learning rate warmup active (type: int, default: 2000)
|
70 |
+
lr_warmup_steps: 200
|
71 |
+
|
72 |
+
# Number of epochs to train on (type: Optional[int], default: null)
|
73 |
+
epochs:
|
74 |
+
|
75 |
+
# Total number of tokens to train on (type: Optional[int], default: 3000000000000)
|
76 |
+
max_tokens: ???
|
77 |
+
|
78 |
+
# Limits the number of optimizer steps to run. (type: Optional[int], default: null)
|
79 |
+
max_steps:
|
80 |
+
|
81 |
+
# Limits the length of samples. Off by default (type: Optional[int], default: null)
|
82 |
+
max_seq_length: 2048
|
83 |
+
|
84 |
+
# Whether to tie the embedding weights with the language modeling head weights. (type: Optional[bool], default: False)
|
85 |
+
tie_embeddings: true
|
86 |
+
|
87 |
+
# (type: Optional[float], default: 1.0)
|
88 |
+
max_norm: 1.0
|
89 |
+
|
90 |
+
# (type: float, default: 4e-05)
|
91 |
+
min_lr: 1e-05
|
92 |
+
|
93 |
+
# Evaluation-related arguments. See ``litgpt.args.EvalArgs`` for details
|
94 |
+
eval:
|
95 |
+
# Number of optimizer steps between evaluation calls (type: int, default: 1000)
|
96 |
+
interval: 50
|
97 |
+
|
98 |
+
# Number of tokens to generate (type: Optional[int], default: null)
|
99 |
+
max_new_tokens:
|
100 |
+
|
101 |
+
# Number of iterations (type: int, default: 100)
|
102 |
+
max_iters: 100
|
103 |
+
|
104 |
+
# Whether to evaluate on the validation set at the beginning of the training
|
105 |
+
initial_validation: false
|
106 |
+
|
107 |
+
# Whether to evaluate on the validation set at the end the training
|
108 |
+
final_validation: true
|
109 |
+
|
110 |
+
# Optimizer-related arguments
|
111 |
+
|
112 |
+
# optimizer:
|
113 |
+
# # class_path: torch.optim.AdamW
|
114 |
+
# class_path: torchao.prototype.low_bit_optim.AdamW8bit
|
115 |
+
# # class_path: torchao.prototype.low_bit_optim.AdamW4bit
|
116 |
+
# # class_path: bitsandbytes.optim.AdamW8bit
|
117 |
+
# # class_path: bitsandbytes.optim.PagedAdamW8bit
|
118 |
+
# init_args:
|
119 |
+
# # (type: float, default: 0.001)
|
120 |
+
# lr: 1e-4
|
121 |
+
# # (type: float, default: 0.01)
|
122 |
+
# weight_decay: 0.01
|
123 |
+
# # (type: tuple, default: (0.9,0.999))
|
124 |
+
# betas:
|
125 |
+
# - 0.9
|
126 |
+
# - 0.99
|
127 |
+
|
128 |
+
optimizer:
|
129 |
+
class_path: dolphinflow.DolphinFlow
|
130 |
+
init_args:
|
131 |
+
lr: 1e-4
|
132 |
+
weight_decay: 0.01
|
133 |
+
momentum: 0.9
|
134 |
+
nesterov: true
|
135 |
+
|
136 |
+
# How many devices/GPUs to use. Uses all GPUs by default. (type: Union[int, str], default: auto)
|
137 |
+
devices: auto
|
138 |
+
|
139 |
+
# How many nodes to use. (type: int, default: 1)
|
140 |
+
num_nodes: 1
|
141 |
+
|
142 |
+
# Optional path to the tokenizer dir that was used for preprocessing the dataset. Only some data
|
143 |
+
# module require this. (type: Optional[Path], default: null)
|
144 |
+
tokenizer_dir: "../"
|
145 |
+
|
146 |
+
# The name of the logger to send metrics to. (type: Literal['wandb', 'tensorboard', 'csv'], default: tensorboard)
|
147 |
+
logger_name: "wandb"
|
148 |
+
|
149 |
+
# The random seed to use for reproducibility. (type: int, default: 42)
|
150 |
+
seed: 23
|
scripts/requirements.in
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
2 |
+
torch>=2.5.0,<2.6.0
|
3 |
+
numpy<2.0
|
4 |
+
|
5 |
+
tqdm
|
6 |
+
Pillow
|
7 |
+
datasets
|
8 |
+
jinja2
|
9 |
+
transformers
|
10 |
+
wandb
|
11 |
+
litgpt[all] @ git+https://github.com/Lightning-AI/litgpt.git
|
12 |
+
mergekit @ git+https://github.com/arcee-ai/mergekit.git
|
13 |
+
# torchao
|
14 |
+
# bitsandbytes
|
15 |
+
# grokadamw
|
16 |
+
# sophia-opt
|
17 |
+
dolphinflow
|
18 |
+
# unsloth
|
19 |
+
lm_eval[ifeval,math]
|
scripts/utils.py
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gc
|
2 |
+
from typing import Optional, Iterator, Callable
|
3 |
+
|
4 |
+
import torch
|
5 |
+
from datasets import load_dataset
|
6 |
+
from litgpt.tokenizer import Tokenizer
|
7 |
+
from transformers import AutoTokenizer
|
8 |
+
|
9 |
+
|
10 |
+
def batch_text_iterator(kind: str,
|
11 |
+
path: str,
|
12 |
+
name: Optional[str]=None,
|
13 |
+
data_dir: Optional[str]=None,
|
14 |
+
data_files: Optional[str]=None,
|
15 |
+
keep_in_memory: bool=False,
|
16 |
+
revision: Optional[str]=None,
|
17 |
+
split: str='train',
|
18 |
+
num_proc: Optional[int]=None,
|
19 |
+
format: Optional[Callable|str]=None) -> Iterator[str]:
|
20 |
+
assert isinstance(format, str) or callable(format), f'{path=} {format=}'
|
21 |
+
assert kind == 'base'
|
22 |
+
|
23 |
+
dataset = load_dataset(path=path,
|
24 |
+
name=name,
|
25 |
+
data_dir=data_dir,
|
26 |
+
data_files=data_files,
|
27 |
+
keep_in_memory=keep_in_memory,
|
28 |
+
revision=revision,
|
29 |
+
split=split,
|
30 |
+
trust_remote_code=True,
|
31 |
+
num_proc=num_proc)
|
32 |
+
|
33 |
+
if callable(format):
|
34 |
+
for row in dataset:
|
35 |
+
text = format(row)
|
36 |
+
yield text
|
37 |
+
else:
|
38 |
+
for row in dataset:
|
39 |
+
text = format.format(**row)
|
40 |
+
yield text
|
41 |
+
|
42 |
+
del dataset
|
43 |
+
gc.collect()
|
44 |
+
|
45 |
+
|
46 |
+
def batch_chat_iterator(kind: str,
|
47 |
+
path: str,
|
48 |
+
name: Optional[str]=None,
|
49 |
+
data_dir: Optional[str]=None,
|
50 |
+
data_files: Optional[str]=None,
|
51 |
+
keep_in_memory: bool=False,
|
52 |
+
revision: Optional[str]=None,
|
53 |
+
split: str='train',
|
54 |
+
num_proc: Optional[int]=None,
|
55 |
+
field: Optional[str]=None,
|
56 |
+
transform: Optional[Callable]=None) -> Iterator[list[dict[str, str]]]:
|
57 |
+
assert kind == 'instruct'
|
58 |
+
|
59 |
+
dataset = load_dataset(path=path,
|
60 |
+
name=name,
|
61 |
+
data_dir=data_dir,
|
62 |
+
data_files=data_files,
|
63 |
+
keep_in_memory=keep_in_memory,
|
64 |
+
revision=revision,
|
65 |
+
split=split,
|
66 |
+
trust_remote_code=True,
|
67 |
+
num_proc=num_proc)
|
68 |
+
|
69 |
+
if callable(transform):
|
70 |
+
for row in dataset:
|
71 |
+
if field:
|
72 |
+
messages = transform(row[field])
|
73 |
+
else:
|
74 |
+
messages = transform(row)
|
75 |
+
|
76 |
+
yield messages
|
77 |
+
else:
|
78 |
+
for row in dataset:
|
79 |
+
if field:
|
80 |
+
messages = row[field]
|
81 |
+
else:
|
82 |
+
raise ValueError(field)
|
83 |
+
|
84 |
+
yield messages
|
85 |
+
|
86 |
+
del dataset
|
87 |
+
gc.collect()
|
88 |
+
|
89 |
+
|
90 |
+
def tokenize_text_fn(dataset_config: dict, hf_tokenizer: AutoTokenizer, tokenizer: Tokenizer) -> Iterator[torch.Tensor]:
|
91 |
+
for text in batch_text_iterator(**dataset_config):
|
92 |
+
text_ids: torch.Tensor = tokenizer.encode(text, bos=False, eos=True)
|
93 |
+
yield text_ids
|
94 |
+
|
95 |
+
|
96 |
+
def tokenize_chat_fn(dataset_config: dict, hf_tokenizer: AutoTokenizer, tokenizer: Tokenizer) -> Iterator[torch.Tensor]:
|
97 |
+
for messages in batch_chat_iterator(**dataset_config):
|
98 |
+
text: str = hf_tokenizer.apply_chat_template(messages, tokenize=False)
|
99 |
+
text_ids: torch.Tensor = tokenizer.encode(text, bos=False, eos=False)
|
100 |
+
yield text_ids
|
101 |
+
|
102 |
+
|
103 |
+
def tokenize_fn(dataset_config: dict, min_len: int, max_len: int, hf_tokenizer: AutoTokenizer, tokenizer: Tokenizer) -> Iterator[torch.Tensor]:
|
104 |
+
if dataset_config['kind'] == 'base':
|
105 |
+
for text in batch_text_iterator(**dataset_config):
|
106 |
+
try:
|
107 |
+
text_ids: torch.Tensor = tokenizer.encode(text, bos=False, eos=True)
|
108 |
+
except Exception as e:
|
109 |
+
print(f'Skip base raw: {e=} {type(text)=} {text=}')
|
110 |
+
continue
|
111 |
+
|
112 |
+
if min_len <= len(text_ids) <= max_len:
|
113 |
+
yield text_ids
|
114 |
+
elif dataset_config['kind'] == 'instruct':
|
115 |
+
for messages in batch_chat_iterator(**dataset_config):
|
116 |
+
try:
|
117 |
+
text: str = hf_tokenizer.apply_chat_template(messages, tokenize=False)
|
118 |
+
text_ids: torch.Tensor = tokenizer.encode(text, bos=False, eos=False)
|
119 |
+
except Exception as e:
|
120 |
+
print(f'Skip instruct row: {e=} {type(messages)=} {messages=}')
|
121 |
+
continue
|
122 |
+
|
123 |
+
if min_len <= len(text_ids) <= max_len:
|
124 |
+
yield text_ids
|
125 |
+
else:
|
126 |
+
raise ValueError(dataset_config['kind'])
|
special_tokens_map.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": "<|endoftext|>",
|
3 |
+
"eos_token": "<|im_end|>",
|
4 |
+
"pad_token": "<|pad|>",
|
5 |
+
"unk_token": "<|unk|>"
|
6 |
+
}
|
tokenizer.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ec6bbc0f441236a44f5889e0a74d2b9f9ecec709739f0f1a0ffb2f946a343b3c
|
3 |
+
size 4253024
|
tokenizer_config.json
ADDED
@@ -0,0 +1,781 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_prefix_space": false,
|
3 |
+
"added_tokens_decoder": {
|
4 |
+
"100256": {
|
5 |
+
"content": "<|dummy_0|>",
|
6 |
+
"lstrip": true,
|
7 |
+
"normalized": false,
|
8 |
+
"rstrip": true,
|
9 |
+
"single_word": false,
|
10 |
+
"special": true
|
11 |
+
},
|
12 |
+
"100257": {
|
13 |
+
"content": "<|endoftext|>",
|
14 |
+
"lstrip": true,
|
15 |
+
"normalized": false,
|
16 |
+
"rstrip": true,
|
17 |
+
"single_word": false,
|
18 |
+
"special": true
|
19 |
+
},
|
20 |
+
"100258": {
|
21 |
+
"content": "<|fim_prefix|>",
|
22 |
+
"lstrip": true,
|
23 |
+
"normalized": false,
|
24 |
+
"rstrip": true,
|
25 |
+
"single_word": false,
|
26 |
+
"special": true
|
27 |
+
},
|
28 |
+
"100259": {
|
29 |
+
"content": "<|fim_middle|>",
|
30 |
+
"lstrip": true,
|
31 |
+
"normalized": false,
|
32 |
+
"rstrip": true,
|
33 |
+
"single_word": false,
|
34 |
+
"special": true
|
35 |
+
},
|
36 |
+
"100260": {
|
37 |
+
"content": "<|fim_suffix|>",
|
38 |
+
"lstrip": true,
|
39 |
+
"normalized": false,
|
40 |
+
"rstrip": true,
|
41 |
+
"single_word": false,
|
42 |
+
"special": true
|
43 |
+
},
|
44 |
+
"100261": {
|
45 |
+
"content": "<|dummy_1|>",
|
46 |
+
"lstrip": true,
|
47 |
+
"normalized": false,
|
48 |
+
"rstrip": true,
|
49 |
+
"single_word": false,
|
50 |
+
"special": true
|
51 |
+
},
|
52 |
+
"100262": {
|
53 |
+
"content": "<|dummy_2|>",
|
54 |
+
"lstrip": true,
|
55 |
+
"normalized": false,
|
56 |
+
"rstrip": true,
|
57 |
+
"single_word": false,
|
58 |
+
"special": true
|
59 |
+
},
|
60 |
+
"100263": {
|
61 |
+
"content": "<|dummy_3|>",
|
62 |
+
"lstrip": true,
|
63 |
+
"normalized": false,
|
64 |
+
"rstrip": true,
|
65 |
+
"single_word": false,
|
66 |
+
"special": true
|
67 |
+
},
|
68 |
+
"100264": {
|
69 |
+
"content": "<|im_start|>",
|
70 |
+
"lstrip": true,
|
71 |
+
"normalized": false,
|
72 |
+
"rstrip": true,
|
73 |
+
"single_word": false,
|
74 |
+
"special": true
|
75 |
+
},
|
76 |
+
"100265": {
|
77 |
+
"content": "<|im_end|>",
|
78 |
+
"lstrip": true,
|
79 |
+
"normalized": false,
|
80 |
+
"rstrip": true,
|
81 |
+
"single_word": false,
|
82 |
+
"special": true
|
83 |
+
},
|
84 |
+
"100266": {
|
85 |
+
"content": "<|im_sep|>",
|
86 |
+
"lstrip": true,
|
87 |
+
"normalized": false,
|
88 |
+
"rstrip": true,
|
89 |
+
"single_word": false,
|
90 |
+
"special": true
|
91 |
+
},
|
92 |
+
"100267": {
|
93 |
+
"content": "<tools>",
|
94 |
+
"lstrip": true,
|
95 |
+
"normalized": false,
|
96 |
+
"rstrip": true,
|
97 |
+
"single_word": false,
|
98 |
+
"special": true
|
99 |
+
},
|
100 |
+
"100268": {
|
101 |
+
"content": "</tools>",
|
102 |
+
"lstrip": true,
|
103 |
+
"normalized": false,
|
104 |
+
"rstrip": true,
|
105 |
+
"single_word": false,
|
106 |
+
"special": true
|
107 |
+
},
|
108 |
+
"100269": {
|
109 |
+
"content": "<tool_call>",
|
110 |
+
"lstrip": true,
|
111 |
+
"normalized": false,
|
112 |
+
"rstrip": true,
|
113 |
+
"single_word": false,
|
114 |
+
"special": true
|
115 |
+
},
|
116 |
+
"100270": {
|
117 |
+
"content": "</tool_call>",
|
118 |
+
"lstrip": true,
|
119 |
+
"normalized": false,
|
120 |
+
"rstrip": true,
|
121 |
+
"single_word": false,
|
122 |
+
"special": true
|
123 |
+
},
|
124 |
+
"100271": {
|
125 |
+
"content": "<tool_response>",
|
126 |
+
"lstrip": true,
|
127 |
+
"normalized": false,
|
128 |
+
"rstrip": true,
|
129 |
+
"single_word": false,
|
130 |
+
"special": true
|
131 |
+
},
|
132 |
+
"100272": {
|
133 |
+
"content": "</tool_response>",
|
134 |
+
"lstrip": true,
|
135 |
+
"normalized": false,
|
136 |
+
"rstrip": true,
|
137 |
+
"single_word": false,
|
138 |
+
"special": true
|
139 |
+
},
|
140 |
+
"100273": {
|
141 |
+
"content": "<think>",
|
142 |
+
"lstrip": true,
|
143 |
+
"normalized": false,
|
144 |
+
"rstrip": true,
|
145 |
+
"single_word": false,
|
146 |
+
"special": true
|
147 |
+
},
|
148 |
+
"100274": {
|
149 |
+
"content": "</think>",
|
150 |
+
"lstrip": true,
|
151 |
+
"normalized": false,
|
152 |
+
"rstrip": true,
|
153 |
+
"single_word": false,
|
154 |
+
"special": true
|
155 |
+
},
|
156 |
+
"100275": {
|
157 |
+
"content": "<|dummy_12|>",
|
158 |
+
"lstrip": true,
|
159 |
+
"normalized": false,
|
160 |
+
"rstrip": true,
|
161 |
+
"single_word": false,
|
162 |
+
"special": true
|
163 |
+
},
|
164 |
+
"100276": {
|
165 |
+
"content": "<|endofprompt|>",
|
166 |
+
"lstrip": true,
|
167 |
+
"normalized": false,
|
168 |
+
"rstrip": true,
|
169 |
+
"single_word": false,
|
170 |
+
"special": true
|
171 |
+
},
|
172 |
+
"100277": {
|
173 |
+
"content": "<|dummy_13|>",
|
174 |
+
"lstrip": true,
|
175 |
+
"normalized": false,
|
176 |
+
"rstrip": true,
|
177 |
+
"single_word": false,
|
178 |
+
"special": true
|
179 |
+
},
|
180 |
+
"100278": {
|
181 |
+
"content": "<|dummy_14|>",
|
182 |
+
"lstrip": true,
|
183 |
+
"normalized": false,
|
184 |
+
"rstrip": true,
|
185 |
+
"single_word": false,
|
186 |
+
"special": true
|
187 |
+
},
|
188 |
+
"100279": {
|
189 |
+
"content": "<|dummy_15|>",
|
190 |
+
"lstrip": true,
|
191 |
+
"normalized": false,
|
192 |
+
"rstrip": true,
|
193 |
+
"single_word": false,
|
194 |
+
"special": true
|
195 |
+
},
|
196 |
+
"100280": {
|
197 |
+
"content": "<|dummy_16|>",
|
198 |
+
"lstrip": true,
|
199 |
+
"normalized": false,
|
200 |
+
"rstrip": true,
|
201 |
+
"single_word": false,
|
202 |
+
"special": true
|
203 |
+
},
|
204 |
+
"100281": {
|
205 |
+
"content": "<|dummy_17|>",
|
206 |
+
"lstrip": true,
|
207 |
+
"normalized": false,
|
208 |
+
"rstrip": true,
|
209 |
+
"single_word": false,
|
210 |
+
"special": true
|
211 |
+
},
|
212 |
+
"100282": {
|
213 |
+
"content": "<|dummy_18|>",
|
214 |
+
"lstrip": true,
|
215 |
+
"normalized": false,
|
216 |
+
"rstrip": true,
|
217 |
+
"single_word": false,
|
218 |
+
"special": true
|
219 |
+
},
|
220 |
+
"100283": {
|
221 |
+
"content": "<|dummy_19|>",
|
222 |
+
"lstrip": true,
|
223 |
+
"normalized": false,
|
224 |
+
"rstrip": true,
|
225 |
+
"single_word": false,
|
226 |
+
"special": true
|
227 |
+
},
|
228 |
+
"100284": {
|
229 |
+
"content": "<|dummy_20|>",
|
230 |
+
"lstrip": true,
|
231 |
+
"normalized": false,
|
232 |
+
"rstrip": true,
|
233 |
+
"single_word": false,
|
234 |
+
"special": true
|
235 |
+
},
|
236 |
+
"100285": {
|
237 |
+
"content": "<|dummy_21|>",
|
238 |
+
"lstrip": true,
|
239 |
+
"normalized": false,
|
240 |
+
"rstrip": true,
|
241 |
+
"single_word": false,
|
242 |
+
"special": true
|
243 |
+
},
|
244 |
+
"100286": {
|
245 |
+
"content": "<|dummy_22|>",
|
246 |
+
"lstrip": true,
|
247 |
+
"normalized": false,
|
248 |
+
"rstrip": true,
|
249 |
+
"single_word": false,
|
250 |
+
"special": true
|
251 |
+
},
|
252 |
+
"100287": {
|
253 |
+
"content": "<|dummy_23|>",
|
254 |
+
"lstrip": true,
|
255 |
+
"normalized": false,
|
256 |
+
"rstrip": true,
|
257 |
+
"single_word": false,
|
258 |
+
"special": true
|
259 |
+
},
|
260 |
+
"100288": {
|
261 |
+
"content": "<|dummy_24|>",
|
262 |
+
"lstrip": true,
|
263 |
+
"normalized": false,
|
264 |
+
"rstrip": true,
|
265 |
+
"single_word": false,
|
266 |
+
"special": true
|
267 |
+
},
|
268 |
+
"100289": {
|
269 |
+
"content": "<|dummy_25|>",
|
270 |
+
"lstrip": true,
|
271 |
+
"normalized": false,
|
272 |
+
"rstrip": true,
|
273 |
+
"single_word": false,
|
274 |
+
"special": true
|
275 |
+
},
|
276 |
+
"100290": {
|
277 |
+
"content": "<|dummy_26|>",
|
278 |
+
"lstrip": true,
|
279 |
+
"normalized": false,
|
280 |
+
"rstrip": true,
|
281 |
+
"single_word": false,
|
282 |
+
"special": true
|
283 |
+
},
|
284 |
+
"100291": {
|
285 |
+
"content": "<|dummy_27|>",
|
286 |
+
"lstrip": true,
|
287 |
+
"normalized": false,
|
288 |
+
"rstrip": true,
|
289 |
+
"single_word": false,
|
290 |
+
"special": true
|
291 |
+
},
|
292 |
+
"100292": {
|
293 |
+
"content": "<|dummy_28|>",
|
294 |
+
"lstrip": true,
|
295 |
+
"normalized": false,
|
296 |
+
"rstrip": true,
|
297 |
+
"single_word": false,
|
298 |
+
"special": true
|
299 |
+
},
|
300 |
+
"100293": {
|
301 |
+
"content": "<|dummy_29|>",
|
302 |
+
"lstrip": true,
|
303 |
+
"normalized": false,
|
304 |
+
"rstrip": true,
|
305 |
+
"single_word": false,
|
306 |
+
"special": true
|
307 |
+
},
|
308 |
+
"100294": {
|
309 |
+
"content": "<|dummy_30|>",
|
310 |
+
"lstrip": true,
|
311 |
+
"normalized": false,
|
312 |
+
"rstrip": true,
|
313 |
+
"single_word": false,
|
314 |
+
"special": true
|
315 |
+
},
|
316 |
+
"100295": {
|
317 |
+
"content": "<|dummy_31|>",
|
318 |
+
"lstrip": true,
|
319 |
+
"normalized": false,
|
320 |
+
"rstrip": true,
|
321 |
+
"single_word": false,
|
322 |
+
"special": true
|
323 |
+
},
|
324 |
+
"100296": {
|
325 |
+
"content": "<|dummy_32|>",
|
326 |
+
"lstrip": true,
|
327 |
+
"normalized": false,
|
328 |
+
"rstrip": true,
|
329 |
+
"single_word": false,
|
330 |
+
"special": true
|
331 |
+
},
|
332 |
+
"100297": {
|
333 |
+
"content": "<|dummy_33|>",
|
334 |
+
"lstrip": true,
|
335 |
+
"normalized": false,
|
336 |
+
"rstrip": true,
|
337 |
+
"single_word": false,
|
338 |
+
"special": true
|
339 |
+
},
|
340 |
+
"100298": {
|
341 |
+
"content": "<|dummy_34|>",
|
342 |
+
"lstrip": true,
|
343 |
+
"normalized": false,
|
344 |
+
"rstrip": true,
|
345 |
+
"single_word": false,
|
346 |
+
"special": true
|
347 |
+
},
|
348 |
+
"100299": {
|
349 |
+
"content": "<|dummy_35|>",
|
350 |
+
"lstrip": true,
|
351 |
+
"normalized": false,
|
352 |
+
"rstrip": true,
|
353 |
+
"single_word": false,
|
354 |
+
"special": true
|
355 |
+
},
|
356 |
+
"100300": {
|
357 |
+
"content": "<|dummy_36|>",
|
358 |
+
"lstrip": true,
|
359 |
+
"normalized": false,
|
360 |
+
"rstrip": true,
|
361 |
+
"single_word": false,
|
362 |
+
"special": true
|
363 |
+
},
|
364 |
+
"100301": {
|
365 |
+
"content": "<|dummy_37|>",
|
366 |
+
"lstrip": true,
|
367 |
+
"normalized": false,
|
368 |
+
"rstrip": true,
|
369 |
+
"single_word": false,
|
370 |
+
"special": true
|
371 |
+
},
|
372 |
+
"100302": {
|
373 |
+
"content": "<|dummy_38|>",
|
374 |
+
"lstrip": true,
|
375 |
+
"normalized": false,
|
376 |
+
"rstrip": true,
|
377 |
+
"single_word": false,
|
378 |
+
"special": true
|
379 |
+
},
|
380 |
+
"100303": {
|
381 |
+
"content": "<|dummy_39|>",
|
382 |
+
"lstrip": true,
|
383 |
+
"normalized": false,
|
384 |
+
"rstrip": true,
|
385 |
+
"single_word": false,
|
386 |
+
"special": true
|
387 |
+
},
|
388 |
+
"100304": {
|
389 |
+
"content": "<|dummy_40|>",
|
390 |
+
"lstrip": true,
|
391 |
+
"normalized": false,
|
392 |
+
"rstrip": true,
|
393 |
+
"single_word": false,
|
394 |
+
"special": true
|
395 |
+
},
|
396 |
+
"100305": {
|
397 |
+
"content": "<|dummy_41|>",
|
398 |
+
"lstrip": true,
|
399 |
+
"normalized": false,
|
400 |
+
"rstrip": true,
|
401 |
+
"single_word": false,
|
402 |
+
"special": true
|
403 |
+
},
|
404 |
+
"100306": {
|
405 |
+
"content": "<|dummy_42|>",
|
406 |
+
"lstrip": true,
|
407 |
+
"normalized": false,
|
408 |
+
"rstrip": true,
|
409 |
+
"single_word": false,
|
410 |
+
"special": true
|
411 |
+
},
|
412 |
+
"100307": {
|
413 |
+
"content": "<|dummy_43|>",
|
414 |
+
"lstrip": true,
|
415 |
+
"normalized": false,
|
416 |
+
"rstrip": true,
|
417 |
+
"single_word": false,
|
418 |
+
"special": true
|
419 |
+
},
|
420 |
+
"100308": {
|
421 |
+
"content": "<|dummy_44|>",
|
422 |
+
"lstrip": true,
|
423 |
+
"normalized": false,
|
424 |
+
"rstrip": true,
|
425 |
+
"single_word": false,
|
426 |
+
"special": true
|
427 |
+
},
|
428 |
+
"100309": {
|
429 |
+
"content": "<|dummy_45|>",
|
430 |
+
"lstrip": true,
|
431 |
+
"normalized": false,
|
432 |
+
"rstrip": true,
|
433 |
+
"single_word": false,
|
434 |
+
"special": true
|
435 |
+
},
|
436 |
+
"100310": {
|
437 |
+
"content": "<|dummy_46|>",
|
438 |
+
"lstrip": true,
|
439 |
+
"normalized": false,
|
440 |
+
"rstrip": true,
|
441 |
+
"single_word": false,
|
442 |
+
"special": true
|
443 |
+
},
|
444 |
+
"100311": {
|
445 |
+
"content": "<|dummy_47|>",
|
446 |
+
"lstrip": true,
|
447 |
+
"normalized": false,
|
448 |
+
"rstrip": true,
|
449 |
+
"single_word": false,
|
450 |
+
"special": true
|
451 |
+
},
|
452 |
+
"100312": {
|
453 |
+
"content": "<|dummy_48|>",
|
454 |
+
"lstrip": true,
|
455 |
+
"normalized": false,
|
456 |
+
"rstrip": true,
|
457 |
+
"single_word": false,
|
458 |
+
"special": true
|
459 |
+
},
|
460 |
+
"100313": {
|
461 |
+
"content": "<|dummy_49|>",
|
462 |
+
"lstrip": true,
|
463 |
+
"normalized": false,
|
464 |
+
"rstrip": true,
|
465 |
+
"single_word": false,
|
466 |
+
"special": true
|
467 |
+
},
|
468 |
+
"100314": {
|
469 |
+
"content": "<|dummy_50|>",
|
470 |
+
"lstrip": true,
|
471 |
+
"normalized": false,
|
472 |
+
"rstrip": true,
|
473 |
+
"single_word": false,
|
474 |
+
"special": true
|
475 |
+
},
|
476 |
+
"100315": {
|
477 |
+
"content": "<|dummy_51|>",
|
478 |
+
"lstrip": true,
|
479 |
+
"normalized": false,
|
480 |
+
"rstrip": true,
|
481 |
+
"single_word": false,
|
482 |
+
"special": true
|
483 |
+
},
|
484 |
+
"100316": {
|
485 |
+
"content": "<|dummy_52|>",
|
486 |
+
"lstrip": true,
|
487 |
+
"normalized": false,
|
488 |
+
"rstrip": true,
|
489 |
+
"single_word": false,
|
490 |
+
"special": true
|
491 |
+
},
|
492 |
+
"100317": {
|
493 |
+
"content": "<|dummy_53|>",
|
494 |
+
"lstrip": true,
|
495 |
+
"normalized": false,
|
496 |
+
"rstrip": true,
|
497 |
+
"single_word": false,
|
498 |
+
"special": true
|
499 |
+
},
|
500 |
+
"100318": {
|
501 |
+
"content": "<|dummy_54|>",
|
502 |
+
"lstrip": true,
|
503 |
+
"normalized": false,
|
504 |
+
"rstrip": true,
|
505 |
+
"single_word": false,
|
506 |
+
"special": true
|
507 |
+
},
|
508 |
+
"100319": {
|
509 |
+
"content": "<|dummy_55|>",
|
510 |
+
"lstrip": true,
|
511 |
+
"normalized": false,
|
512 |
+
"rstrip": true,
|
513 |
+
"single_word": false,
|
514 |
+
"special": true
|
515 |
+
},
|
516 |
+
"100320": {
|
517 |
+
"content": "<|dummy_56|>",
|
518 |
+
"lstrip": true,
|
519 |
+
"normalized": false,
|
520 |
+
"rstrip": true,
|
521 |
+
"single_word": false,
|
522 |
+
"special": true
|
523 |
+
},
|
524 |
+
"100321": {
|
525 |
+
"content": "<|dummy_57|>",
|
526 |
+
"lstrip": true,
|
527 |
+
"normalized": false,
|
528 |
+
"rstrip": true,
|
529 |
+
"single_word": false,
|
530 |
+
"special": true
|
531 |
+
},
|
532 |
+
"100322": {
|
533 |
+
"content": "<|dummy_58|>",
|
534 |
+
"lstrip": true,
|
535 |
+
"normalized": false,
|
536 |
+
"rstrip": true,
|
537 |
+
"single_word": false,
|
538 |
+
"special": true
|
539 |
+
},
|
540 |
+
"100323": {
|
541 |
+
"content": "<|dummy_59|>",
|
542 |
+
"lstrip": true,
|
543 |
+
"normalized": false,
|
544 |
+
"rstrip": true,
|
545 |
+
"single_word": false,
|
546 |
+
"special": true
|
547 |
+
},
|
548 |
+
"100324": {
|
549 |
+
"content": "<|dummy_60|>",
|
550 |
+
"lstrip": true,
|
551 |
+
"normalized": false,
|
552 |
+
"rstrip": true,
|
553 |
+
"single_word": false,
|
554 |
+
"special": true
|
555 |
+
},
|
556 |
+
"100325": {
|
557 |
+
"content": "<|dummy_61|>",
|
558 |
+
"lstrip": true,
|
559 |
+
"normalized": false,
|
560 |
+
"rstrip": true,
|
561 |
+
"single_word": false,
|
562 |
+
"special": true
|
563 |
+
},
|
564 |
+
"100326": {
|
565 |
+
"content": "<|dummy_62|>",
|
566 |
+
"lstrip": true,
|
567 |
+
"normalized": false,
|
568 |
+
"rstrip": true,
|
569 |
+
"single_word": false,
|
570 |
+
"special": true
|
571 |
+
},
|
572 |
+
"100327": {
|
573 |
+
"content": "<|dummy_63|>",
|
574 |
+
"lstrip": true,
|
575 |
+
"normalized": false,
|
576 |
+
"rstrip": true,
|
577 |
+
"single_word": false,
|
578 |
+
"special": true
|
579 |
+
},
|
580 |
+
"100328": {
|
581 |
+
"content": "<|dummy_64|>",
|
582 |
+
"lstrip": true,
|
583 |
+
"normalized": false,
|
584 |
+
"rstrip": true,
|
585 |
+
"single_word": false,
|
586 |
+
"special": true
|
587 |
+
},
|
588 |
+
"100329": {
|
589 |
+
"content": "<|dummy_65|>",
|
590 |
+
"lstrip": true,
|
591 |
+
"normalized": false,
|
592 |
+
"rstrip": true,
|
593 |
+
"single_word": false,
|
594 |
+
"special": true
|
595 |
+
},
|
596 |
+
"100330": {
|
597 |
+
"content": "<|dummy_66|>",
|
598 |
+
"lstrip": true,
|
599 |
+
"normalized": false,
|
600 |
+
"rstrip": true,
|
601 |
+
"single_word": false,
|
602 |
+
"special": true
|
603 |
+
},
|
604 |
+
"100331": {
|
605 |
+
"content": "<|dummy_67|>",
|
606 |
+
"lstrip": true,
|
607 |
+
"normalized": false,
|
608 |
+
"rstrip": true,
|
609 |
+
"single_word": false,
|
610 |
+
"special": true
|
611 |
+
},
|
612 |
+
"100332": {
|
613 |
+
"content": "<|dummy_68|>",
|
614 |
+
"lstrip": true,
|
615 |
+
"normalized": false,
|
616 |
+
"rstrip": true,
|
617 |
+
"single_word": false,
|
618 |
+
"special": true
|
619 |
+
},
|
620 |
+
"100333": {
|
621 |
+
"content": "<|dummy_69|>",
|
622 |
+
"lstrip": true,
|
623 |
+
"normalized": false,
|
624 |
+
"rstrip": true,
|
625 |
+
"single_word": false,
|
626 |
+
"special": true
|
627 |
+
},
|
628 |
+
"100334": {
|
629 |
+
"content": "<|dummy_70|>",
|
630 |
+
"lstrip": true,
|
631 |
+
"normalized": false,
|
632 |
+
"rstrip": true,
|
633 |
+
"single_word": false,
|
634 |
+
"special": true
|
635 |
+
},
|
636 |
+
"100335": {
|
637 |
+
"content": "<|dummy_71|>",
|
638 |
+
"lstrip": true,
|
639 |
+
"normalized": false,
|
640 |
+
"rstrip": true,
|
641 |
+
"single_word": false,
|
642 |
+
"special": true
|
643 |
+
},
|
644 |
+
"100336": {
|
645 |
+
"content": "<|dummy_72|>",
|
646 |
+
"lstrip": true,
|
647 |
+
"normalized": false,
|
648 |
+
"rstrip": true,
|
649 |
+
"single_word": false,
|
650 |
+
"special": true
|
651 |
+
},
|
652 |
+
"100337": {
|
653 |
+
"content": "<|dummy_73|>",
|
654 |
+
"lstrip": true,
|
655 |
+
"normalized": false,
|
656 |
+
"rstrip": true,
|
657 |
+
"single_word": false,
|
658 |
+
"special": true
|
659 |
+
},
|
660 |
+
"100338": {
|
661 |
+
"content": "<|dummy_74|>",
|
662 |
+
"lstrip": true,
|
663 |
+
"normalized": false,
|
664 |
+
"rstrip": true,
|
665 |
+
"single_word": false,
|
666 |
+
"special": true
|
667 |
+
},
|
668 |
+
"100339": {
|
669 |
+
"content": "<|dummy_75|>",
|
670 |
+
"lstrip": true,
|
671 |
+
"normalized": false,
|
672 |
+
"rstrip": true,
|
673 |
+
"single_word": false,
|
674 |
+
"special": true
|
675 |
+
},
|
676 |
+
"100340": {
|
677 |
+
"content": "<|dummy_76|>",
|
678 |
+
"lstrip": true,
|
679 |
+
"normalized": false,
|
680 |
+
"rstrip": true,
|
681 |
+
"single_word": false,
|
682 |
+
"special": true
|
683 |
+
},
|
684 |
+
"100341": {
|
685 |
+
"content": "<|dummy_77|>",
|
686 |
+
"lstrip": true,
|
687 |
+
"normalized": false,
|
688 |
+
"rstrip": true,
|
689 |
+
"single_word": false,
|
690 |
+
"special": true
|
691 |
+
},
|
692 |
+
"100342": {
|
693 |
+
"content": "<|dummy_78|>",
|
694 |
+
"lstrip": true,
|
695 |
+
"normalized": false,
|
696 |
+
"rstrip": true,
|
697 |
+
"single_word": false,
|
698 |
+
"special": true
|
699 |
+
},
|
700 |
+
"100343": {
|
701 |
+
"content": "<|dummy_79|>",
|
702 |
+
"lstrip": true,
|
703 |
+
"normalized": false,
|
704 |
+
"rstrip": true,
|
705 |
+
"single_word": false,
|
706 |
+
"special": true
|
707 |
+
},
|
708 |
+
"100344": {
|
709 |
+
"content": "<|dummy_80|>",
|
710 |
+
"lstrip": true,
|
711 |
+
"normalized": false,
|
712 |
+
"rstrip": true,
|
713 |
+
"single_word": false,
|
714 |
+
"special": true
|
715 |
+
},
|
716 |
+
"100345": {
|
717 |
+
"content": "<|dummy_81|>",
|
718 |
+
"lstrip": true,
|
719 |
+
"normalized": false,
|
720 |
+
"rstrip": true,
|
721 |
+
"single_word": false,
|
722 |
+
"special": true
|
723 |
+
},
|
724 |
+
"100346": {
|
725 |
+
"content": "<|dummy_82|>",
|
726 |
+
"lstrip": true,
|
727 |
+
"normalized": false,
|
728 |
+
"rstrip": true,
|
729 |
+
"single_word": false,
|
730 |
+
"special": true
|
731 |
+
},
|
732 |
+
"100347": {
|
733 |
+
"content": "<|dummy_83|>",
|
734 |
+
"lstrip": true,
|
735 |
+
"normalized": false,
|
736 |
+
"rstrip": true,
|
737 |
+
"single_word": false,
|
738 |
+
"special": true
|
739 |
+
},
|
740 |
+
"100348": {
|
741 |
+
"content": "<|dummy_84|>",
|
742 |
+
"lstrip": true,
|
743 |
+
"normalized": false,
|
744 |
+
"rstrip": true,
|
745 |
+
"single_word": false,
|
746 |
+
"special": true
|
747 |
+
},
|
748 |
+
"100349": {
|
749 |
+
"content": "<|dummy_85|>",
|
750 |
+
"lstrip": true,
|
751 |
+
"normalized": false,
|
752 |
+
"rstrip": true,
|
753 |
+
"single_word": false,
|
754 |
+
"special": true
|
755 |
+
},
|
756 |
+
"100350": {
|
757 |
+
"content": "<|pad|>",
|
758 |
+
"lstrip": true,
|
759 |
+
"normalized": false,
|
760 |
+
"rstrip": true,
|
761 |
+
"single_word": false,
|
762 |
+
"special": true
|
763 |
+
},
|
764 |
+
"100351": {
|
765 |
+
"content": "<|unk|>",
|
766 |
+
"lstrip": true,
|
767 |
+
"normalized": false,
|
768 |
+
"rstrip": true,
|
769 |
+
"single_word": false,
|
770 |
+
"special": true
|
771 |
+
}
|
772 |
+
},
|
773 |
+
"bos_token": "<|endoftext|>",
|
774 |
+
"chat_template": "{% for message in messages %}{% if (message['role'] == 'system') %}{{'<|im_start|>system<|im_sep|>' + message['content'] + '<|im_end|>'}}{% elif (message['role'] == 'user') %}{{'<|im_start|>user<|im_sep|>' + message['content'] + '<|im_end|>'}}{% elif (message['role'] == 'assistant') %}{{'<|im_start|>assistant<|im_sep|>' + message['content'] + '<|im_end|>'}}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant<|im_sep|>' }}{% endif %}",
|
775 |
+
"clean_up_tokenization_spaces": false,
|
776 |
+
"eos_token": "<|im_end|>",
|
777 |
+
"model_max_length": 16384,
|
778 |
+
"pad_token": "<|pad|>",
|
779 |
+
"tokenizer_class": "GPT2Tokenizer",
|
780 |
+
"unk_token": "<|unk|>"
|
781 |
+
}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|