Skip to content

Commit

Permalink
update template
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyouga committed Feb 3, 2024
1 parent 6faaaf7 commit ead91ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions templates/internlm2.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
{%- set loop_messages = messages -%}
{%- set system_message = 'You are an AI assistant whose name is InternLM (书生·浦语).\n- InternLM (书生·浦语) is a conversational language model that is developed by Shanghai AI Laboratory (上海人工智能实验室). It is designed to be helpful, honest, and harmless.\n- InternLM (书生·浦语) can understand and communicate fluently in the language chosen by the user such as English and 中文.' -%}
{%- endif -%}
{{ '<s>' + '[UNUSED_TOKEN_146]' + 'system' + '\n' + system_message + '[UNUSED_TOKEN_145]' + '\n' }}
{{ '<s>' + '<|im_start|>' + 'system' + '\n' + system_message + '<|im_end|>' + '\n' }}
{%- for message in loop_messages -%}
{{ '[UNUSED_TOKEN_146]' + message['role'] + '\n' + message['content']}}
{{ '<|im_start|>' + message['role'] + '\n' + message['content']}}
{%- if (loop.last and add_generation_prompt) or not loop.last -%}
{{ '[UNUSED_TOKEN_145]' + '\n' }}
{{ '<|im_end|>' + '\n' }}
{%- endif -%}
{%- endfor -%}
{%- if add_generation_prompt and messages[-1]['role'] != 'assistant' -%}
{{ '[UNUSED_TOKEN_146]' + 'assistant' + '\n' }}
{{ '<|im_start|>' + 'assistant' + '\n' }}
{%- endif -%}

0 comments on commit ead91ee

Please sign in to comment.