Bingsu's picture
Create chat_template.jinja
6844b45 verified
<|im_start|>tool_list
<|im_end|>
{% for message in messages %}
{% set content = message['content'] %}
{% set role = message['role'] %}
{% if loop.first and role != 'system' %}
<|im_start|>system
You are a helpful assistant.<|im_end|>
{% endif %}
{% if message['content'] is string %}
<|im_start|>{{ role }}
{{ message['content'] }}<|im_end|>
{% else %}
{% if content['type'] == 'image' %}
<|im_start|>{{ role }} (mime)
{"type": "image/jpeg", "filename": "{{ content['filename'] }}"}<|im_end|>
<|im_start|>{{ role }} (vector)
<|dummy3|><|im_end|>
<|im_start|>image/aux
다음 중 ocr은 사진에서 검출된 글자이고, lens_keyword는 사진에서 추출된 keyword와 bbox 위치입니다. bbox는 0~1 사이로 정규화된 [x1, y1, x2, y2]의 형태입니다. 참고하여 답변하세요. {"ocr": "{{ content['ocr'] or '' }}", "lens_keywords": "{{ content['lens_keywords'] or '' }}", "lens_local_keywords": "{{ content['lens_local_keywords'] or '' }}"}<|im_end|>
{% elif content['type'] == 'video' %}
<|im_start|>{{ role }} (mime)
{"type": "video/mp4", "filename": "{{ content['filename'] }}"}<|im_end|>
<|im_start|>{{ role }} (vector)
<|dummy3|><|im_end|>
<|im_start|>image/aux
{% if content.get('is_final_grid') %}
다음 중 lens_keyword는 사진에서 추출된 keyword와 bbox 위치입니다. bbox는 0~1 사이로 정규화된 [x1, y1, x2, y2]의 형태입니다. video_time_stamp는 비디오에서 해당 구간의 시간 정보입니다. speech_to_text는 비디오 속에서의 대화, 음성, 소리, 대사, 그리고 말을 전부 글로 받아 적은 것 입니다. 참고하여 답변하세요. {"video_time_stamp": "{{ content['video_time_stamp'] }}", "lens_keywords": "{{ content.get('lens_keywords', '') }}", "lens_local_keywords": "{{ content.get('lens_local_keywords', '') }}", "speech_to_text": "{{ content.get('speech_to_text', '') }}"}
{% else %}
다음 중 video_time_stamp는 비디오에서 해당 구간의 시간 정보입니다. 참고하여 답변하세요. {"video_time_stamp": "{{ content['video_time_stamp'] }}"}
{% endif %}<|im_end|>
{% elif content['type'] == 'text' %}
<|im_start|>{{ role }}
{{ content['text'] }}<|im_end|>
{% endif %}
{% endif %}
{% endfor %}
{% if add_generation_prompt %}
<|im_start|>assistant
{% endif %}