mirror of
https://github.com/deepseek-ai/DeepSeek-LLM.git
synced 2026-11-05 00:57:25 +00:00
[GH-ISSUE #28] 关于System Prompt #17
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepSeek-LLM#17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @DirtyKnightForVi on GitHub (Jan 9, 2024).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-LLM/issues/28
首先感谢你们的优秀开源工作!
在你们发布的技术报告中提到的System Prompt,与你们在DeepSeek coder模板中的第一句提示词接近。
不过,在你们发布的67B的chat模型中,我检查了你们发布的tokenizer_config.json,发现模板中没有位置加入这个提示词。
请问System Prompt应该是加在哪里呢?
另外你们有function call或者agent版本的模型开发计划吗?
@stack-heap-overflow commented on GitHub (Jan 9, 2024):
感谢您对我们工作的关注。
实际上,我们在
tokenizer_config.json的chat_template中已经预留了System Prompt的位置:"chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{{ bos_token }}{% for message in messages %}{% if message['role'] == 'user' %}{{ 'User: ' + message['content'] + '\n\n' }}{% elif message['role'] == 'assistant' %}{{ 'Assistant: ' + message['content'] + eos_token }}{% elif message['role'] == 'system' %}{{ message['content'] + '\n\n' }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ 'Assistant:' }}{% endif %}"
在使用时需要保证system消息唯一且位于第一条的位置就能得到符合我们预期的结果。
@DirtyKnightForVi commented on GitHub (Jan 9, 2024):
在coder 33B这个模型上其实也有实验过:
你们的found_item参数似乎无法起作用。不管我的system是否设置了,模型还是会将默认的“you are a AI programming assistant ···”这个提示词一起输出。
虽然我也注意到你们更新了tokenizer_config.json,里面抛弃了这个参数。
@stack-heap-overflow commented on GitHub (Jan 9, 2024):
在包括Tokenizer在内的部分实现细节上,chat和coder模型并不完全一致。使用不同模型时请以对应模型的
chat_template为准。在chat模型中并没有默认指定System Prompt,如有需要可以自行在消息列表中添加。@DirtyKnightForVi commented on GitHub (Jan 9, 2024):
我的意思是:在之前coder对应的
chat_template里,带了一个叫做found_item的参数,以此来控制System Prompt。在此基础上,我发现他确实能把
用户自定义的System Prompt信息带进去,但是仍然会输出你们预先设置的提示词“you are a AI programming assistant ···”。这意味着两个system prompt。然后很遗憾,用户的这个并没有起到作用。
这应该是你们最初版本的模板:

按你们这个模板的话,预设的这个提示词应该不显示才对。
@suncheng-s commented on GitHub (Oct 25, 2024):
请问,后面有找到原因吗?