-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add system role to deepseek chat template #3031
Conversation
model = MODELS.get('deepseek')()
messages = [{
'role': 'system',
'content': 'you are a helpful assistant'
}, {
'role': 'user',
'content': 'who are you'
}, {
'role': 'assistant',
'content': 'I am an AI'
}, {
'role': 'user',
'content': 'hi'
}]
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained(
'deepseek-ai/DeepSeek-V2-Lite', trust_remote_code=True)
ref = tokenizer.apply_chat_template(messages, tokenize=False)
res = '<|begin▁of▁sentence|>' + model.messages2prompt(messages)
assert res.startswith(ref) It tests failed using the above case. |
But in real testing, 'who are you' should be responsed with |
Can we add UTs to cover ti? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Conflicts: lmdeploy/model.py
'content': 'hi' | ||
}] | ||
from transformers import AutoTokenizer | ||
tokenizer = AutoTokenizer.from_pretrained('deepseek-ai/DeepSeek-V2-Lite', trust_remote_code=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding test cases for DeepSeek V3 and DeepSeek R1 here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in #3072
No description provided.