langgz commited on
Commit
c9a572e
·
verified ·
1 Parent(s): f7a3431

Preserve all transcription context and keywords

Browse files
Files changed (1) hide show
  1. chat_template.jinja +2 -2
chat_template.jinja CHANGED
@@ -8,8 +8,8 @@ You are a helpful assistant.<|im_end|>
8
  **上下文信息:**
9
 
10
 
11
- {% if text_items %}{{ text_items[0]['text'] }}
12
- {% endif %}{% if keyword_items %}热词列表:[{{ keyword_items[0]['keywords'] | join(', ') }}]
13
  {% endif %}{% endif %}语音转写{% if language_items %}成{{ language_items[0]['language'] }}{% endif %}:{% for content in audio_items %}<|object_ref_start|>{% endfor %}{% else %}{% for content in message['content'] %}{% if content['type'] == 'audio' %}<|object_ref_start|>{% elif content['type'] == 'text' %}{{ content['text'] }}{% endif %}{% endfor %}{% endif %}<|im_end|>
14
  {% endif %}{% endfor %}{% if add_generation_prompt %}<|im_start|>assistant
15
  {% endif %}
 
8
  **上下文信息:**
9
 
10
 
11
+ {% for item in text_items %}{{ item['text'] }}
12
+ {% endfor %}{% set keyword_namespace = namespace(items=[]) %}{% for item in keyword_items %}{% set keyword_namespace.items = keyword_namespace.items + item['keywords'] %}{% endfor %}{% if keyword_namespace.items %}热词列表:[{{ keyword_namespace.items | join(', ') }}]
13
  {% endif %}{% endif %}语音转写{% if language_items %}成{{ language_items[0]['language'] }}{% endif %}:{% for content in audio_items %}<|object_ref_start|>{% endfor %}{% else %}{% for content in message['content'] %}{% if content['type'] == 'audio' %}<|object_ref_start|>{% elif content['type'] == 'text' %}{{ content['text'] }}{% endif %}{% endfor %}{% endif %}<|im_end|>
14
  {% endif %}{% endfor %}{% if add_generation_prompt %}<|im_start|>assistant
15
  {% endif %}