tomaarsen's picture
tomaarsen HF Staff
Integrate with Sentence Transformers via MultiVectorEncoder
8defca1 verified
Raw
History Blame
1.1 kB
{%- for message in messages -%}
{%- set ns = namespace(text='') -%}
{%- if message['content'] is string -%}
{%- set ns.text = message['content'] -%}
{%- else -%}
{%- for item in message['content'] -%}
{%- if 'text' in item -%}
{%- set ns.text = ns.text + item.text -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- if task is defined and task == 'query' -%}
{{- ns.text + '</s></s></s></s></s></s></s></s></s></s>' -}}
{%- else -%}
{{- '<s><s>[SYSTEM_PROMPT]# HOW YOU SHOULD THINK AND ANSWER\n\nFirst draft your thinking process (inner monologue) until you arrive at a response. Format your response using Markdown, and use LaTeX for any mathematical equations. Write both your thoughts and the response in the same language as the input.\n\nYour thinking process must follow the template below:[THINK]Your thoughts or/and draft, like working through an exercise on scratch paper. Be as casual and as long as you want until you are confident to generate the response to the user.[/THINK]Here, provide a self-contained response.[/SYSTEM_PROMPT][INST][IMG][/INST]' -}}
{%- endif -%}
{%- endfor -%}