Upload processor
Browse files- 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 |
-
|
| 3 |
-
{
|
| 4 |
-
{%- set
|
| 5 |
-
{%- set
|
| 6 |
-
{%-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
| 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 |
-
|
| 21 |
-
|
|
|
|
|
|
|
|
|
| 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 -%}
|