diff --git a/default/content/index.json b/default/content/index.json index ac88da3e3..449c55289 100644 --- a/default/content/index.json +++ b/default/content/index.json @@ -795,6 +795,14 @@ "filename": "presets/context/DeepSeek-V2.5.json", "type": "context" }, + { + "filename": "presets/instruct/GLM-4.json", + "type": "instruct" + }, + { + "filename": "presets/context/GLM-4.json", + "type": "context" + }, { "filename": "presets/reasoning/DeepSeek.json", "type": "reasoning" diff --git a/default/content/presets/context/GLM-4.json b/default/content/presets/context/GLM-4.json new file mode 100644 index 000000000..f250f60fd --- /dev/null +++ b/default/content/presets/context/GLM-4.json @@ -0,0 +1,11 @@ +{ + "story_string": "[gMASK]\n{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{trim}}\n", + "example_separator": "", + "chat_start": "", + "use_stop_strings": false, + "allow_jailbreak": false, + "always_force_name2": true, + "trim_sentences": false, + "single_line": false, + "name": "GLM-4" +} diff --git a/default/content/presets/instruct/GLM-4.json b/default/content/presets/instruct/GLM-4.json new file mode 100644 index 000000000..8fb081365 --- /dev/null +++ b/default/content/presets/instruct/GLM-4.json @@ -0,0 +1,22 @@ +{ + "input_sequence": "<|user|>\n", + "output_sequence": "<|assistant|>\n", + "first_output_sequence": "", + "last_output_sequence": "", + "system_sequence_prefix": "<|system|>\n", + "system_sequence_suffix": "", + "stop_sequence": "", + "wrap": false, + "macro": true, + "names_behavior": "force", + "activation_regex": "", + "skip_examples": false, + "output_suffix": "", + "input_suffix": "", + "system_sequence": "", + "system_suffix": "", + "user_alignment_message": "", + "last_system_sequence": "", + "system_same_as_user": true, + "name": "GLM-4" +} diff --git a/public/scripts/chat-templates.js b/public/scripts/chat-templates.js index 5c3ad7cf1..95bac803f 100644 --- a/public/scripts/chat-templates.js +++ b/public/scripts/chat-templates.js @@ -74,6 +74,11 @@ const hash_derivations = { 'b6835114b7303ddd78919a82e4d9f7d8c26ed0d7dfc36beeb12d524f6144eab1': 'DeepSeek-V2.5' , + + // THUDM-GLM 4 + '854b703e44ca06bdb196cc471c728d15dbab61e744fe6cdce980086b61646ed1': + 'GLM-4' + , }; const substr_derivations = {