From 7877e6601da89971ba505a6915a349a2d14be658 Mon Sep 17 00:00:00 2001 From: Karl-Johan Alm Date: Wed, 22 Jan 2025 13:13:41 +0900 Subject: [PATCH 1/3] add presets for DeepSeek R1 models --- default/content/index.json | 8 +++++++ .../content/presets/context/DeepSeek-R1.json | 11 ++++++++++ .../content/presets/instruct/DeepSeek-R1.json | 22 +++++++++++++++++++ public/scripts/chat-templates.js | 5 +++++ 4 files changed, 46 insertions(+) create mode 100644 default/content/presets/context/DeepSeek-R1.json create mode 100644 default/content/presets/instruct/DeepSeek-R1.json diff --git a/default/content/index.json b/default/content/index.json index 6df03b78d..bcabafa3d 100644 --- a/default/content/index.json +++ b/default/content/index.json @@ -782,5 +782,13 @@ { "filename": "presets/context/Mistral V7.json", "type": "context" + }, + { + "filename": "presets/instruct/DeepSeek-R1.json", + "type": "instruct" + }, + { + "filename": "presets/context/DeepSeek-R1.json", + "type": "context" } ] diff --git a/default/content/presets/context/DeepSeek-R1.json b/default/content/presets/context/DeepSeek-R1.json new file mode 100644 index 000000000..e84c66ced --- /dev/null +++ b/default/content/presets/context/DeepSeek-R1.json @@ -0,0 +1,11 @@ +{ + "story_string": "{{#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": "DeepSeek-R1" +} diff --git a/default/content/presets/instruct/DeepSeek-R1.json b/default/content/presets/instruct/DeepSeek-R1.json new file mode 100644 index 000000000..db5e5f907 --- /dev/null +++ b/default/content/presets/instruct/DeepSeek-R1.json @@ -0,0 +1,22 @@ +{ + "input_sequence": "<|User|>", + "output_sequence": "<|Assistant|>", + "first_output_sequence": "", + "last_output_sequence": "", + "system_sequence_prefix": "", + "system_sequence_suffix": "", + "stop_sequence": "", + "wrap": false, + "macro": true, + "names_behavior": "always", + "activation_regex": "", + "skip_examples": false, + "output_suffix": "<|end▁of▁sentence|>", + "input_suffix": "", + "system_sequence": "", + "system_suffix": "", + "user_alignment_message": "", + "last_system_sequence": "", + "system_same_as_user": false, + "name": "DeepSeek-R1" +} diff --git a/public/scripts/chat-templates.js b/public/scripts/chat-templates.js index ea732b90c..19baa9d11 100644 --- a/public/scripts/chat-templates.js +++ b/public/scripts/chat-templates.js @@ -59,6 +59,11 @@ const hash_derivations = { // Tulu-3-8B // Tulu-3-70B 'Tulu' + , + + // DeepSeek R1 + 'b6835114b7303ddd78919a82e4d9f7d8c26ed0d7dfc36beeb12d524f6144eab1': + 'DeepSeek-R1' }; const substr_derivations = { From 636e79c4388cf925ad1a3df2f2b71735d36b02ab Mon Sep 17 00:00:00 2001 From: Karl-Johan Alm Date: Wed, 22 Jan 2025 16:03:03 +0900 Subject: [PATCH 2/3] fixes --- default/content/index.json | 4 ++-- .../presets/context/{DeepSeek-R1.json => DeepSeek-V2.5.json} | 2 +- .../presets/instruct/{DeepSeek-R1.json => DeepSeek-V2.5.json} | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) rename default/content/presets/context/{DeepSeek-R1.json => DeepSeek-V2.5.json} (95%) rename default/content/presets/instruct/{DeepSeek-R1.json => DeepSeek-V2.5.json} (90%) diff --git a/default/content/index.json b/default/content/index.json index bcabafa3d..82387d0a9 100644 --- a/default/content/index.json +++ b/default/content/index.json @@ -784,11 +784,11 @@ "type": "context" }, { - "filename": "presets/instruct/DeepSeek-R1.json", + "filename": "presets/instruct/DeepSeek-V2.5.json", "type": "instruct" }, { - "filename": "presets/context/DeepSeek-R1.json", + "filename": "presets/context/DeepSeek-V2.5.json", "type": "context" } ] diff --git a/default/content/presets/context/DeepSeek-R1.json b/default/content/presets/context/DeepSeek-V2.5.json similarity index 95% rename from default/content/presets/context/DeepSeek-R1.json rename to default/content/presets/context/DeepSeek-V2.5.json index e84c66ced..49efaba59 100644 --- a/default/content/presets/context/DeepSeek-R1.json +++ b/default/content/presets/context/DeepSeek-V2.5.json @@ -7,5 +7,5 @@ "always_force_name2": true, "trim_sentences": false, "single_line": false, - "name": "DeepSeek-R1" + "name": "DeepSeek-V2.5" } diff --git a/default/content/presets/instruct/DeepSeek-R1.json b/default/content/presets/instruct/DeepSeek-V2.5.json similarity index 90% rename from default/content/presets/instruct/DeepSeek-R1.json rename to default/content/presets/instruct/DeepSeek-V2.5.json index db5e5f907..63fb45362 100644 --- a/default/content/presets/instruct/DeepSeek-R1.json +++ b/default/content/presets/instruct/DeepSeek-V2.5.json @@ -8,7 +8,7 @@ "stop_sequence": "", "wrap": false, "macro": true, - "names_behavior": "always", + "names_behavior": "force", "activation_regex": "", "skip_examples": false, "output_suffix": "<|end▁of▁sentence|>", @@ -18,5 +18,5 @@ "user_alignment_message": "", "last_system_sequence": "", "system_same_as_user": false, - "name": "DeepSeek-R1" + "name": "DeepSeek-V2.5" } From 2b00cdce7b6fdd282ef47f58753fc3329b1bdd00 Mon Sep 17 00:00:00 2001 From: Karl-Johan Alm Date: Wed, 22 Jan 2025 17:07:23 +0900 Subject: [PATCH 3/3] system same as user --- default/content/presets/instruct/DeepSeek-V2.5.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default/content/presets/instruct/DeepSeek-V2.5.json b/default/content/presets/instruct/DeepSeek-V2.5.json index 63fb45362..7990d13c0 100644 --- a/default/content/presets/instruct/DeepSeek-V2.5.json +++ b/default/content/presets/instruct/DeepSeek-V2.5.json @@ -17,6 +17,6 @@ "system_suffix": "", "user_alignment_message": "", "last_system_sequence": "", - "system_same_as_user": false, + "system_same_as_user": true, "name": "DeepSeek-V2.5" }