Skip to content

Commit cea5643

Browse files
authored
Register OpenAI GPT-OSS and GPT-OSS-SAFEGUARD Presets to kerashub. (#2473)
* Test GPT_OSS files through porter * generate API and moved files to respective folders * Fix format issues * Add gpt_oss to preset loader and Fix format issues * Add gpt_oss to preset loader * generated files through 2.5-pro model * Format fix * Add converter, RoPE update * Fix format * Fix BPE tests * Update converter * Fix converter, checkpoints conversion and attention * Fix the parameter count and debug code * Add dequantization logic to converter * Add YaRN support,Fix Serialisation,Fix dequantization * Fixed several pytest tests * Address gpt_oss_causal_lm tests * Fix format issues * Address review comments * set start token id to None to match the HF output * Fix test cases * Fix test * Fix error * Fix * Address all comments * Register GPT-OSS Presets * FIx fromat
1 parent b238c7d commit cea5643

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed
Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,51 @@
1-
backbone_presets = {}
1+
backbone_presets = {
2+
"gpt_oss_20b_en": {
3+
"metadata": {
4+
"description": (
5+
"This preset has 21 billion total parameters, "
6+
"with 3.6 billion active parameters, a 128k context "
7+
"length, and is de-quantized from MXFP4."
8+
),
9+
"params": 20_914_757_184,
10+
"path": "gpt_oss",
11+
},
12+
"kaggle_handle": "kaggle://keras/gpt-oss/keras/gpt_oss_20b_en/1",
13+
},
14+
"gpt_oss_120b_en": {
15+
"metadata": {
16+
"description": (
17+
"This preset has 117 billion total parameters, "
18+
"with 5.1 billion active parameters, a 128k context "
19+
"length, and is de-quantized from MXFP4."
20+
),
21+
"params": 116_829_156_672,
22+
"path": "gpt_oss",
23+
},
24+
"kaggle_handle": "kaggle://keras/gpt-oss/keras/gpt_oss_120b_en/1",
25+
},
26+
"gpt_oss_safeguard_20b_en": {
27+
"metadata": {
28+
"description": (
29+
"Open-weight safety reasoning model with 21 billion "
30+
"total parameters,with 3.6 billion active "
31+
"parameters, a context length of over 128k, "
32+
"and is de-quantized from MXFP4."
33+
),
34+
"params": 20_914_757_184,
35+
"path": "gpt_oss",
36+
},
37+
"kaggle_handle": "kaggle://keras/gpt-oss-safeguard/keras/gpt_oss_safeguard_20b_en/1",
38+
},
39+
"gpt_oss_safeguard_120b_en": {
40+
"metadata": {
41+
"description": (
42+
"Open-weight safety reasoning model with 117 billion "
43+
"total parameters,with 5.1 billion active parameters, "
44+
"a 128k context length, and is de-quantized from MXFP4."
45+
),
46+
"params": 116_829_156_672,
47+
"path": "gpt_oss",
48+
},
49+
"kaggle_handle": "kaggle://keras/gpt-oss-safeguard/keras/gpt_oss_safeguard_120b_en/1",
50+
},
51+
}

tools/checkpoint_conversion/convert_gpt_oss_checkpoints.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
PRESET_MAP = {
3131
"gpt_oss_20b_en": "openai/gpt-oss-20b",
3232
"gpt_oss_120b_en": "openai/gpt-oss-120b",
33+
"gpt_oss_safeguard_20b_en": "openai/gpt-oss-safeguard-20b",
34+
"gpt_oss_safeguard_120b_en": "openai/gpt-oss-safeguard-120b",
3335
}
3436

3537
FLAGS = flags.FLAGS

0 commit comments

Comments
 (0)