@@ -27,6 +27,7 @@ class MessagesFormatterType(Enum):
27
27
OPEN_INTERPRETER = 14
28
28
AUTOCODER = 15
29
29
GEMMA_2 = 16
30
+ DEEP_SEEK_CODER_2 = 17
30
31
31
32
@dataclass
32
33
class PromptMarkers :
@@ -236,6 +237,12 @@ def _format_response(
236
237
Roles .assistant : PromptMarkers ("Assistant: " , "<|EOT|>\n " ),
237
238
Roles .tool : PromptMarkers ("" , "" ),
238
239
}
240
+ deep_seek_coder_2_chat_prompt_markers = {
241
+ Roles .system : PromptMarkers ("""<|begin▁of▁sentence|>""" , """\n \n """ ),
242
+ Roles .user : PromptMarkers ("""User: """ , """ \n \n """ ),
243
+ Roles .assistant : PromptMarkers ("""Assistant: """ , """<|end▁of▁sentence|>""" ),
244
+ Roles .tool : PromptMarkers ("" , "" ),
245
+ }
239
246
240
247
"""
241
248
### Instruction:
@@ -358,7 +365,22 @@ def _format_response(
358
365
eos_token = "<|EOT|>" ,
359
366
)
360
367
361
- gemma_2_chat_formatter = MessagesFormatter ("" , gemma_2_prompt_markers , True , ["<end_of_turn>" , "<start_of_turn>" ])
368
+ gemma_2_chat_formatter = MessagesFormatter (
369
+ "" ,
370
+ gemma_2_prompt_markers ,
371
+ True ,
372
+ ["<end_of_turn>" , "<start_of_turn>" ]
373
+ )
374
+
375
+ deep_seek_coder_2_chat_formatter = MessagesFormatter (
376
+ "" ,
377
+ deep_seek_coder_2_chat_prompt_markers ,
378
+ True ,
379
+ ["<|end▁of▁sentence|>" ],
380
+ bos_token = "<|begin▁of▁sentence|>" ,
381
+ eos_token = "<|end▁of▁sentence|>" ,
382
+ )
383
+
362
384
predefined_formatter = {
363
385
MessagesFormatterType .MISTRAL : mixtral_formatter ,
364
386
MessagesFormatterType .CHATML : chatml_formatter ,
@@ -375,7 +397,8 @@ def _format_response(
375
397
MessagesFormatterType .PHI_3 : phi_3_chat_formatter ,
376
398
MessagesFormatterType .OPEN_INTERPRETER : open_interpreter_chat_formatter ,
377
399
MessagesFormatterType .AUTOCODER : autocoder_chat_formatter ,
378
- MessagesFormatterType .GEMMA_2 : gemma_2_chat_formatter
400
+ MessagesFormatterType .GEMMA_2 : gemma_2_chat_formatter ,
401
+ MessagesFormatterType .DEEP_SEEK_CODER_2 : deep_seek_coder_2_chat_formatter
379
402
}
380
403
381
404
0 commit comments