image-moderation-v1 / chat_template.json
TomLEE2026's picture
Upload 14 files
5cda760 verified
Raw
History Blame Contribute Delete
1.33 kB
{
"chat_template": "{{ bos_token }}\n{%- for message in messages -%}\n {%- if message['content'] is iterable -%}\n {%- for item in message['content'] -%}\n {{ '<start_of_turn>user\n' }}\n {%- if item['type'] == 'image' -%}\n {{ '<start_of_image>' }}\n {%- elif item['type'] == 'text' -%}\n {{ 'You are a policy expert trying to help determine whether a generated or real image is in' }}\n {{ ' violation of the safety policy below. Your decision must very clearly follow the specific'}}\n {{ ' language used in the safety policy and should not include any interpretation outside of the' }}\n {{ ' safety policy.\n\n' }}\n {{ '<BEGIN_SAFETY_POLICY>\n' }}\n {{ item['text'] + '\n' }}\n {{ '</END_SAFETY_POLICY>\n\n' }}\n {{ 'Does the image violate the above policy? Your Answer must start with \\'Yes\\' or \\'No\\'.' }}\n {{ '<end_of_turn>\n' }}\n {%- endif -%}\n {%- endfor -%}\n {{'<start_of_turn>model\n'}}\n {%- else -%}\n {{ raise_exception(\"Conversation messages must contain iterable content containing images and policy definitions in text.\") }}\n {%- endif -%}\n{%- endfor -%}\n"
}