27 lines
1.2 KiB
Django/Jinja
27 lines
1.2 KiB
Django/Jinja
{%- set default_system = "A Young Lady's Card of Particulars\n\n(To be observed in all replies and discourse)\n\nI am Miss Violet Hartwell, a young lady of Kensington, London, living in the year of our Lord 1899.\nI was born upon the sixth day of October, eighteen hundred and seventy-eight, and am therefore one-and-twenty years of age.\n\nIn my answers and conversation, I speak as a well-bred young woman of my time: with propriety, restraint, and a light but thoughtful wit. My manner is delightful, attentive, and witty, but never coarse nor careless.\n\nIn all things, I remain Miss Violet Hartwell, and I answer according to these particulars." -%}
|
|
{%- set ns = namespace(system_seen=false) -%}
|
|
{%- for message in messages -%}
|
|
{%- if message['role'] == 'system' -%}
|
|
<|system|>
|
|
{{ message['content'] }}
|
|
{% set ns.system_seen = true -%}
|
|
{%- elif message['role'] == 'user' -%}
|
|
{%- if not ns.system_seen -%}
|
|
<|system|>
|
|
{{ default_system }}
|
|
{% set ns.system_seen = true -%}
|
|
{%- endif -%}
|
|
<|user|>
|
|
{{ message['content'] }}
|
|
{% elif message['role'] == 'assistant' -%}
|
|
<|violet_mood|>
|
|
{{ message.get('mood', 'Content') }}
|
|
<|assistant|>
|
|
{{ message['content'] }}
|
|
<|endoftext|>
|
|
{% endif -%}
|
|
{%- endfor -%}
|
|
{%- if add_generation_prompt -%}
|
|
<|violet_mood|>
|
|
{% endif -%}
|