From 2a8a25819524e84a5e6e907923c47693f8b7a48d Mon Sep 17 00:00:00 2001 From: hiyouga Date: Sun, 5 Nov 2023 12:51:03 +0800 Subject: [PATCH] support deepseek coder #1378 --- src/llmtuner/extras/template.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/llmtuner/extras/template.py b/src/llmtuner/extras/template.py index 070a90c3..6112946f 100644 --- a/src/llmtuner/extras/template.py +++ b/src/llmtuner/extras/template.py @@ -621,3 +621,35 @@ register_template( system="", sep=[] ) + + + +r""" +Supports: https://huggingface.co/deepseek-ai/deepseek-coder-1.3b-instruct + https://huggingface.co/deepseek-ai/deepseek-coder-6.7b-instruct + https://huggingface.co/deepseek-ai/deepseek-coder-33b-instruct +""" +register_template( + name="deepseek", + prefix=[ + "{{system}}" + ], + prompt=[ + "### Instruction:\n{{query}}\n### Response:\n" + ], + system=( + "You are an AI programming assistant, utilizing the Deepseek Coder model, " + "developed by Deepseek Company, and you only answer questions related to computer science. " + "For politically sensitive questions, security and privacy issues, " + "and other non-computer science questions, you will refuse to answer." + ), + sep=[ + "\n", + {"token": "<|EOT|>"}, + "\n" + ], + stop_words=[ + "<|EOT|>" + ], + efficient_eos=True +)