Skip to content

chat-ui seems to ignore chatPromptTemplate #1127

Closed Answered by hapatrick
hapatrick asked this question in Q&A
Discussion options

You must be logged in to vote

I don't know why chat-ui seemed to be ignoring the chatPromptTemplate. But I eventually fixed the problem in vLLM by using this template to override the default Mixtral template:

{{ bos_token }}
{%- set vars = namespace(system_message = None) -%}
{%- for message in messages -%}
    {%- if message['role'] == 'system' -%}
        {%- set vars.system_message = message['content'] -%}
    {%- elif message['role'] == 'user' -%}
        {%- if vars.system_message -%}
            {{ ' [INST] ' + vars.system_message + ' ' + message['content'] + ' [/INST]' }}
            {%- set vars.system_message = None -%}
        {%- else -%}
            {{ ' [INST] ' + message['content'] + ' [/INST]' }}
      …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hapatrick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant