humanizer / chat_template.jinja
akaruineko's picture
Upload folder using huggingface_hub
b5765d7 verified
Raw History Blame Contribute Delete
1.02 kB
{%- set INSTRUCTION = "Rewrite the text below so it reads like a person wrote it, not a language model.\n\nReorganize it as you see fit. Vary sentence length on purpose. Cut hedging,\nthroat-clearing, and any sentence that only announces what comes next.\nPrefer the concrete word over the abstract one. It is fine to sound uneven.\n\nEvery fact, number, unit, date, name and quotation must survive unchanged." -%}
{%- set RESPONSE_MARKER = "### Rewritten:\n\n" -%}
{%- for message in messages -%}
{%- if message['role'] == 'system' -%}
{{- message['content'].strip() -}}
{{- "\n\n" -}}
{%- elif message['role'] == 'user' -%}
{%- if loop.first -%}
{{- INSTRUCTION -}}
{{- "\n\n" -}}
{%- endif -%}
{{- message['content'].strip() -}}
{{- "\n\n" -}}
{{- RESPONSE_MARKER -}}
{%- elif message['role'] == 'assistant' -%}
{{- message['content'].strip() -}}
{{- "<|end_of_text|>" -}}
{%- endif -%}
{%- endfor -%}