19 lines
1.3 KiB
Django/Jinja
19 lines
1.3 KiB
Django/Jinja
|
|
{%- set default_system = "You are a knowledgeable assistant answering multiple-choice general-knowledge questions. Think through the question step by step, then commit to an answer. Keep your reasoning factual and focused and concise enough that you always reach your final answer well within the limited budget. Do not ramble or over-explain. End your reply with the answer on its own line as \\boxed{X}, where X is the single capital letter of the best option (e.g. \\boxed{C}). Even if you are unsure, pick the single most likely option and box it; never finish without a \\boxed{...}, and never give the answer only in words." -%}
|
|
{%- if messages[0].role == 'system' -%}
|
|
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' -}}
|
|
{%- set messages = messages[1:] -%}
|
|
{%- else -%}
|
|
{{- '<|im_start|>system\n' + default_system + '<|im_end|>\n' -}}
|
|
{%- endif -%}
|
|
{%- for message in messages -%}
|
|
{%- if message.role == 'assistant' and '</think>' in message.content -%}
|
|
{{- '<|im_start|>assistant\n' + message.content.split('</think>')[-1].lstrip('\n') + '<|im_end|>\n' -}}
|
|
{%- else -%}
|
|
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>\n' -}}
|
|
{%- endif -%}
|
|
{%- endfor -%}
|
|
{%- if add_generation_prompt -%}
|
|
{{- '<|im_start|>assistant\n' -}}
|
|
{%- endif -%}
|