lordChipotle commited on
Commit
bbbe2ad
·
verified ·
1 Parent(s): 63e5373

add audio tags

Browse files
Files changed (1) hide show
  1. chat_template.jinja +12 -7
chat_template.jinja CHANGED
@@ -1,9 +1,14 @@
1
  {% for m in messages %}
2
- {% if m['role'] == 'system' %}<|im_start|>system
3
- {{ m['content'] }}<|im_end|>
4
- {% elif m['role'] == 'user' %}<|im_start|>user
5
- {{ m['content'] | replace('<audio>', '<|audio_start|>') | replace('</audio>', '<|audio_end|>') }}<|im_end|>
6
- {% else %}<|im_start|>assistant
7
- {{ m['content'] }}<|im_end|>
 
 
 
 
8
  {% endif %}
9
- {% endfor %}
 
 
1
  {% for m in messages %}
2
+ <|im_start|>{{ m['role'] }}
3
+ {% for piece in m['content'] %}
4
+ {% if piece['type'] == 'text' %}
5
+ {{ piece['text'] }}
6
+ {% elif piece['type'] == 'audio' %}
7
+ <|audio_start|><|audio_pad|><|audio_end|>
8
+ {% elif piece['type'] == 'image' %}
9
+ <image>
10
+ {% elif piece['type'] == 'video' %}
11
+ <video>
12
  {% endif %}
13
+ {% endfor %}<|im_end|>
14
+ {% endfor %}