Download chat_template.jinja from hf-tiny-v2/tiny-random-JanusModel: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/hf-tiny-v2/tiny-random-JanusModel/resolve/main/chat_template.jinja
- Command line
-
hf download hf://hf-tiny-v2/tiny-random-JanusModel/chat_template.jinja
-
curl -L -o chat_template.jinja https://huggingface.co/hf-tiny-v2/tiny-random-JanusModel/resolve/main/chat_template.jinja
1.03 kB
| {%set seps=[' | |
| ','<|end▁of▁sentence|>']%}{%set i=0%}{%for message in messages%}{%if message['role']|lower=='user'%}<|User|>: {%elif message['role']|lower=='assistant'%}<|Assistant|>:{%if not (loop.last and not add_generation_prompt and message['content'][0]['type']=='text' and message['content'][0]['text']=='')%} {%endif%}{%else%}{{message['role'].capitalize()}}: {%endif%}{%for content in message['content']%}{%if content['type']=='image'%}{%if not loop.first%}{{' | |
| '}}{%endif%}<image_placeholder>{%if not loop.last%}{{' | |
| '}}{%endif%}{%elif content['type']=='text'%}{%set text=content['text']%}{%if loop.first%}{%set text=text.lstrip()%}{%endif%}{%if loop.last%}{%set text=text.rstrip()%}{%endif%}{%if not loop.first and message['content'][loop.index0-1]['type']=='text'%}{{' '+text}}{%else%}{{text}}{%endif%}{%endif%}{%endfor%}{%if not loop.last or add_generation_prompt%}{%if message['role']|lower=='user'%}{{seps[0]}}{%else%}{{seps[1]}}{%endif%}{%endif%}{%endfor%}{%if add_generation_prompt%}<|Assistant|>:{%endif%} |