Giter Club home page Giter Club logo

Comments (4)

stack-heap-overflow avatar stack-heap-overflow commented on June 28, 2024

感谢您对我们工作的关注。

实际上,我们在tokenizer_config.jsonchat_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消息唯一且位于第一条的位置就能得到符合我们预期的结果。

from deepseek-llm.

DirtyKnightForVi avatar DirtyKnightForVi commented on June 28, 2024

感谢您对我们工作的关注。

实际上,我们在tokenizer_config.jsonchat_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消息唯一且位于第一条的位置就能得到符合我们预期的结果。

在coder 33B这个模型上其实也有实验过:
你们的found_item参数似乎无法起作用。不管我的system是否设置了,模型还是会将默认的“you are a AI programming assistant ···”这个提示词一起输出。

虽然我也注意到你们更新了tokenizer_config.json,里面抛弃了这个参数。

from deepseek-llm.

stack-heap-overflow avatar stack-heap-overflow commented on June 28, 2024

在包括Tokenizer在内的部分实现细节上,chat和coder模型并不完全一致。使用不同模型时请以对应模型的chat_template为准。在chat模型中并没有默认指定System Prompt,如有需要可以自行在消息列表中添加。

from deepseek-llm.

DirtyKnightForVi avatar DirtyKnightForVi commented on June 28, 2024

在包括Tokenizer在内的部分实现细节上,chat和coder模型并不完全一致。使用不同模型时请以对应模型的chat_template为准。在chat模型中并没有默认指定System Prompt,如有需要可以自行在消息列表中添加。

我的意思是:在之前coder对应的chat_template里,带了一个叫做found_item的参数,以此来控制System Prompt。
在此基础上,我发现他确实能把用户自定义的System Prompt信息带进去,但是仍然会输出你们预先设置的提示词
“you are a AI programming assistant ···”。这意味着两个system prompt。

微信图片_20240109171225

然后很遗憾,用户的这个并没有起到作用。

这应该是你们最初版本的模板:
微信图片_20240109171738

微信图片_20240109172100

按你们这个模板的话,预设的这个提示词应该不显示才对。

from deepseek-llm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.