Skip to content

Commit

Permalink
Add RWKV-World instruction template (#6456)
Browse files Browse the repository at this point in the history
  • Loading branch information
MollySophia authored Oct 14, 2024
1 parent e784938 commit 18f836b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions instruction-templates/RWKV-World.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
instruction_template: |-
{%- set ns = namespace(found=false) -%}
{%- for message in messages -%}
{%- if message['role'] == 'system' -%}
{%- set ns.found = true -%}
{%- endif -%}
{%- endfor -%}
{%- if not ns.found -%}
{{- '' + '' + '' -}}
{%- endif %}
{%- for message in messages %}
{%- if message['role'] == 'system' -%}
{{- '' + message['content'] + '' -}}
{%- else -%}
{%- if message['role'] == 'user' -%}
{{-'User: ' + message['content'] + '\n\n'-}}
{%- else -%}
{{-'Assistant: ' + message['content'] + '\n\n' -}}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- if add_generation_prompt -%}
{{-'Assistant:'-}}
{%- endif -%}

0 comments on commit 18f836b

Please sign in to comment.