Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
af6c5357
"git@developer.sourcefind.cn:modelzoo/gpt2_migraphx.git" did not exist on "9a6a11a490c9ec8388ca8bc83ff8f52f70e2ce2c"
Unverified
Commit
af6c5357
authored
Jan 20, 2025
by
Enrique Shockwave
Committed by
GitHub
Jan 20, 2025
Browse files
deepseek v3 and r1 chat template (#3015)
parent
3ad4cd49
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
python/sglang/lang/chat_template.py
python/sglang/lang/chat_template.py
+31
-0
No files found.
python/sglang/lang/chat_template.py
View file @
af6c5357
...
...
@@ -354,6 +354,37 @@ register_chat_template(
)
register_chat_template
(
ChatTemplate
(
name
=
"deepseek-v3"
,
default_system_prompt
=
None
,
role_prefix_and_suffix
=
{
"system"
:
(
""
,
""
,
),
"user"
:
(
"<|User|>"
,
""
,
),
"assistant"
:
(
"<|Assistant|>"
,
"<|end▁of▁sentence|>"
,
),
},
stop_str
=
(
"<|end▁of▁sentence|>"
,),
)
)
@
register_chat_template_matching_function
def
match_deepseek
(
model_path
:
str
):
if
(
"deepseek-v3"
in
model_path
.
lower
()
or
"deepseek-r1"
in
model_path
.
lower
()
)
and
"base"
not
in
model_path
.
lower
():
return
get_chat_template
(
"deepseek-v3"
)
@
register_chat_template_matching_function
def
match_dbrx
(
model_path
:
str
):
if
"dbrx"
in
model_path
.
lower
()
and
"instruct"
in
model_path
.
lower
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment