Bingsu commited on
Commit
6844b45
·
verified ·
1 Parent(s): 5d305f4

Create chat_template.jinja

Browse files
Files changed (1) hide show
  1. chat_template.jinja +40 -0
chat_template.jinja ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <|im_start|>tool_list
2
+ <|im_end|>
3
+ {% for message in messages %}
4
+ {% set content = message['content'] %}
5
+ {% set role = message['role'] %}
6
+ {% if loop.first and role != 'system' %}
7
+ <|im_start|>system
8
+ You are a helpful assistant.<|im_end|>
9
+ {% endif %}
10
+ {% if message['content'] is string %}
11
+ <|im_start|>{{ role }}
12
+ {{ message['content'] }}<|im_end|>
13
+ {% else %}
14
+ {% if content['type'] == 'image' %}
15
+ <|im_start|>{{ role }} (mime)
16
+ {"type": "image/jpeg", "filename": "{{ content['filename'] }}"}<|im_end|>
17
+ <|im_start|>{{ role }} (vector)
18
+ <|dummy3|><|im_end|>
19
+ <|im_start|>image/aux
20
+ 다음 중 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|>
21
+ {% elif content['type'] == 'video' %}
22
+ <|im_start|>{{ role }} (mime)
23
+ {"type": "video/mp4", "filename": "{{ content['filename'] }}"}<|im_end|>
24
+ <|im_start|>{{ role }} (vector)
25
+ <|dummy3|><|im_end|>
26
+ <|im_start|>image/aux
27
+ {% if content.get('is_final_grid') %}
28
+ 다음 중 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', '') }}"}
29
+ {% else %}
30
+ 다음 중 video_time_stamp는 비디오에서 해당 구간의 시간 정보입니다. 참고하여 답변하세요. {"video_time_stamp": "{{ content['video_time_stamp'] }}"}
31
+ {% endif %}<|im_end|>
32
+ {% elif content['type'] == 'text' %}
33
+ <|im_start|>{{ role }}
34
+ {{ content['text'] }}<|im_end|>
35
+ {% endif %}
36
+ {% endif %}
37
+ {% endfor %}
38
+ {% if add_generation_prompt %}
39
+ <|im_start|>assistant
40
+ {% endif %}