hf-transformers-bot HF Staff
Update tiny models for PerceptionLMForConditionalGeneration
bce4f4a verified Download chat_template.jinja from hf-tiny-v2/tiny-random-PerceptionLMForConditionalGeneration: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/hf-tiny-v2/tiny-random-PerceptionLMForConditionalGeneration/resolve/main/chat_template.jinja
- Command line
-
hf download hf://hf-tiny-v2/tiny-random-PerceptionLMForConditionalGeneration/chat_template.jinja
-
curl -L -o chat_template.jinja https://huggingface.co/hf-tiny-v2/tiny-random-PerceptionLMForConditionalGeneration/resolve/main/chat_template.jinja
1.07 kB
| {{- bos_token }}{%- if messages[0]['role'] == 'system' -%} {%- set system_message = messages[0]['content']|trim %} | |
| {%- set messages = messages[1:] %} | |
| {%- else %} {%- set system_message = 'You are a helpful language and vision assistant. You are able to understand the visual content that the user provides, and assist the user with a variety of tasks using natural language.' %}{%- endif %}{{- '<|start_header_id|>system<|end_header_id|>\n\n' }}{{- system_message }}{{- '<|eot_id|>' }}{%- for message in messages %}{{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n' }}{%- for content in message['content'] | selectattr('type', 'equalto', 'image') %}{{ '<|image|>' }}{%- endfor %}{%- for content in message['content'] | selectattr('type', 'equalto', 'video') %}{{ '<|video|>' }}{%- endfor %}{%- for content in message['content'] | selectattr('type', 'equalto', 'text') %}{{- content['text'] | trim }}{%- endfor %}{{'<|eot_id|>' }}{%- endfor %}{%- if add_generation_prompt %}{{- '<|start_header_id|>assistant<|end_header_id|>\n\n' }}{%- endif %} |