bezzam HF Staff commited on
Commit
0d33119
·
verified ·
1 Parent(s): 3414b83

Upload processor

Browse files
Files changed (1) hide show
  1. chat_template.jinja +20 -15
chat_template.jinja CHANGED
@@ -1,21 +1,26 @@
1
  {%- set system_prompt = system_prompt | default("You are a helpful assistant that transcribes audio input into text output in JSON format.") -%}
2
- {{ system_prompt }}
3
- {%- set audio_token = audio_token | default("<|box_start|>") %}
4
- {%- set audio_start_token = "<|object_ref_start|>" %}
5
- {%- set audio_end_token = "<|object_ref_end|>" %}
6
- {%- for message in messages %}
7
- {%- if message['role'] == 'user' %}
8
- {%- set text_items = message['content'] | selectattr('type', 'equalto', 'text') | list %}
9
- {%- set context_text = text_items[0]['text'] if text_items else none %}
10
- {%- for item in message['content'] %}
11
- {%- if item['type'] == 'audio' %}
 
 
 
12
  {{ audio_start_token }}{{ audio_token }}{{ audio_end_token }}{{ "
13
  " }}{%- if context_text -%}
14
  This is a <|AUDIO_DURATION|> seconds audio, with extra info: {{ context_text }}
15
 
16
  Please transcribe it with these keys: Start time, End time, Speaker ID, Content{%- else -%}
17
- This is a <|AUDIO_DURATION|> seconds audio, please transcribe it with these keys: Start time, End time, Speaker ID, Content{%- endif %}
18
- {%- endif %}
19
- {%- endfor %}
20
- {%- endif %}
21
- {%- endfor %}
 
 
 
1
  {%- set system_prompt = system_prompt | default("You are a helpful assistant that transcribes audio input into text output in JSON format.") -%}
2
+ <|im_start|>system
3
+ {{ system_prompt }}<|im_end|>
4
+ {%- set audio_token = audio_token | default("<|box_start|>") -%}
5
+ {%- set audio_start_token = "<|object_ref_start|>" -%}
6
+ {%- set audio_end_token = "<|object_ref_end|>" -%}
7
+ {%- for message in messages -%}
8
+ {%- if message['role'] == 'user' -%}
9
+ {{ '
10
+ ' }}<|im_start|>user{{ '
11
+ ' }}{%- set text_items = message['content'] | selectattr('type', 'equalto', 'text') | list -%}
12
+ {%- set context_text = text_items[0]['text'] if text_items else none -%}
13
+ {%- for item in message['content'] -%}
14
+ {%- if item['type'] == 'audio' -%}
15
  {{ audio_start_token }}{{ audio_token }}{{ audio_end_token }}{{ "
16
  " }}{%- if context_text -%}
17
  This is a <|AUDIO_DURATION|> seconds audio, with extra info: {{ context_text }}
18
 
19
  Please transcribe it with these keys: Start time, End time, Speaker ID, Content{%- else -%}
20
+ This is a <|AUDIO_DURATION|> seconds audio, please transcribe it with these keys: Start time, End time, Speaker ID, Content{%- endif -%}
21
+ {%- endif -%}
22
+ {%- endfor -%}
23
+ <|im_end|>{{ '
24
+ ' }}
25
+ {%- endif -%}
26
+ {%- endfor -%}