AntonV HF Staff commited on
Commit
89d8d60
·
verified ·
1 Parent(s): e94fa64

Delete chat_template.jinja

Browse files
Files changed (1) hide show
  1. chat_template.jinja +0 -81
chat_template.jinja DELETED
@@ -1,81 +0,0 @@
1
-
2
- {%- set image_count = namespace(value=0) -%}
3
- {%- set video_count = namespace(value=0) -%}
4
- {{- '<|begin_of_sentence|>' }}
5
- {%- for message in messages -%}
6
- {%- if message.role in ['system', 'user'] -%}
7
- {%- if message.role == 'user' -%}
8
- {{- 'User: ' -}}
9
- {%- endif -%}
10
- {%- if message.content is string -%}
11
- {{- message.content -}}
12
- {%- else -%}
13
- {%- for content_item in message.content -%}
14
- {%- if content_item.type == 'text' -%}
15
- {{- content_item.text -}}
16
- {%- elif content_item.type in ['image_url', 'image'] -%}
17
- {%- set image_count.value = image_count.value + 1 -%}
18
- Picture {{ image_count.value }}:<|IMAGE_START|><|IMAGE_PLACEHOLDER|><|IMAGE_END|>
19
- {%- elif content_item.type in ['video_url', 'video'] -%}
20
- {%- set video_count.value = video_count.value + 1 -%}
21
- Video {{ video_count.value }}:<|VIDEO_START|><|VIDEO_PLACEHOLDER|><|VIDEO_END|>
22
- {%- endif -%}
23
- {%- endfor -%}
24
- {%- endif -%}
25
- {%- if message.role == 'system' -%}
26
- {{- '
27
- ' -}}
28
- {%- endif -%}
29
- {%- elif message.role == 'assistant' -%}
30
- {%- macro extract_text_content(content_field) -%}
31
- {%- if content_field is string -%}
32
- {{- content_field -}}
33
- {%- elif content_field is iterable and content_field is not string -%}
34
- {%- set ns = namespace(text_parts=[]) -%}
35
- {%- set text_parts = [] -%}
36
- {%- for item in content_field -%}
37
- {%- if item.type == 'text' -%}
38
- {%- set ns.text_parts = ns.text_parts + [item.text] -%}
39
- {%- endif -%}
40
- {%- endfor -%}
41
- {{- ns.text_parts | join("") -}}
42
- {%- else -%}
43
- {{- '' -}}
44
- {%- endif -%}
45
- {%- endmacro -%}
46
- {%- set reasoning_content = extract_text_content(message.reasoning_content) -%}
47
- {%- set content = extract_text_content(message.content) -%}
48
- {%- if '</think>' in content %}
49
- {%- set reasoning_content = content.split('</think>')[0].rstrip('
50
- ').split('<think>')[-1].lstrip('
51
- ') %}
52
- {%- set content = content.split('</think>')[-1].lstrip('
53
- ') %}
54
- {%- endif %}
55
- {%- if reasoning_content %}
56
- {{- '
57
- ' + 'Assistant: ' + '<think>
58
- ' + reasoning_content.strip('
59
- ') + '
60
- </think>
61
- ' + content.lstrip('
62
- ') }}
63
- {%- else %}
64
- {{- '
65
- ' + 'Assistant: ' + content }}
66
- {%- endif %}
67
- {{- '<|end_of_sentence |>' }}
68
- {%- endif -%}
69
- {%- endfor -%}
70
- {%- if add_generation_prompt is not defined or add_generation_prompt is true %}
71
- {{- '
72
- Assistant: ' -}}
73
- {%- if (enable_thinking is defined and enable_thinking is false) or enable_thinking is not defined %}
74
- {{- '<think>
75
-
76
- </think>
77
-
78
- ' }}
79
- {%- endif %}
80
- {%- if enable_thinking is defined and enable_thinking is true %}{{- '<think>' }}{%- endif %}
81
- {%- endif %}