Skip to content

Commit 34487d3

Browse files
committed
gpt oss harmony template
1 parent 6eea7b8 commit 34487d3

File tree

5 files changed

+37
-3
lines changed

5 files changed

+37
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ add_compile_definitions(LOG_DISABLE_LOGS)
6161
add_compile_definitions(GGML_USE_CPU)
6262
add_compile_definitions(GGML_USE_CPU_REPACK)
6363
add_compile_definitions(NOMINMAX)
64-
add_compile_definitions(_REGEX_MAX_STACK_COUNT=80000)
64+
add_compile_definitions(_REGEX_MAX_STACK_COUNT=32000)
6565

6666
if (GGML_HIP_FORCE_ROCWMMA_FATTN_GFX12)
6767
add_compile_definitions(GGML_HIP_ROCWMMA_FATTN_GFX12)

gpttype_adapter.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,15 +2293,21 @@ ModelLoadResult gpttype_load_model(const load_model_inputs inputs, FileFormat in
22932293
// std::string forced = "per_layer_token_embd.weight=CPU"; //this tensor on gpu is problematic on unsloth q4_0
22942294
// tensoroverrides = (tensoroverrides=="" ? forced: (forced+","+tensoroverrides));
22952295
// }
2296-
if(tensoroverrides=="" && ggml_backend_dev_count()>1 && inputs.moecpu>0)
2296+
if(ggml_backend_dev_count()>1 && inputs.moecpu>0)
22972297
{
2298+
std::string toadd = "";
22982299
for (int i = 0; i < inputs.moecpu; ++i) {
22992300
std::string tmp = string_format("blk\\.%d\\.ffn_(up|down|gate)_exps=CPU", i);
23002301
if(i>0)
23012302
{
23022303
tmp = "," + tmp;
23032304
}
2304-
tensoroverrides += tmp;
2305+
toadd += tmp;
2306+
}
2307+
if (tensoroverrides == "") {
2308+
tensoroverrides = toadd;
2309+
} else {
2310+
tensoroverrides += "," + toadd;
23052311
}
23062312
printf("Overriding %d MoE layers to CPU...\n",inputs.moecpu);
23072313
}

kcpp_adapters/AutoGuess.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,17 @@
186186
"assistant_start": "<|response|>",
187187
"assistant_end": "<|endofresponse|>"
188188
}
189+
}, {
190+
"search": ["<|start|>user<|message|>", "<|channel|>", "<|end|>"],
191+
"name": "OpenAI Harmony",
192+
"adapter": {
193+
"system_start": "<|start|>system<|message|>",
194+
"system_end": "<|end|>\n",
195+
"user_start": "<|start|>user<|message|>",
196+
"user_end": "<|end|>\n",
197+
"assistant_start": "<|start|>assistant<|channel|>final<|message|>",
198+
"assistant_end": "<|return|>\n"
199+
}
189200
}, {
190201
"search": ["rwkv_", "'User: '"],
191202
"name": "RWKV World",

kcpp_adapters/OpenAI-Harmony.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"system_start": "<|start|>system<|message|>",
3+
"system_end": "<|end|>\n",
4+
"user_start": "<|start|>user<|message|>",
5+
"user_end": "<|end|>\n",
6+
"assistant_start": "<|start|>assistant<|channel|>final<|message|>",
7+
"assistant_end": "<|return|>\n"
8+
}

klite.embd

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3629,6 +3629,15 @@ Current version indicated by LITEVER below.
36293629
"assistant_end":"",
36303630
"system":"",
36313631
"system_end":"",
3632+
},
3633+
{
3634+
"name":"OpenAI Harmony",
3635+
"user":"<|start|>user<|message|>",
3636+
"user_end":"<|end|>\\n",
3637+
"assistant":"<|start|>assistant<|channel|>final<|message|>",
3638+
"assistant_end":"<|return|>\\n",
3639+
"system":"<|start|>system<|message|>",
3640+
"system_end":"<|end|>\\n",
36323641
}
36333642
];
36343643

0 commit comments

Comments
 (0)