Daizee commited on
Commit
9b27659
·
verified ·
1 Parent(s): 30a4b06

Delete chat_template.jinja

Browse files
Files changed (1) hide show
  1. chat_template.jinja +0 -34
chat_template.jinja DELETED
@@ -1,34 +0,0 @@
1
- {{ bos_token }}
2
- {%- set loop_messages = messages -%}
3
- {%- for message in loop_messages -%}
4
- {%- if message['role'] == 'system' -%}
5
- {%- set role = 'user' -%}
6
- {%- elif message['role'] == 'assistant' -%}
7
- {%- set role = 'model' -%}
8
- {%- else -%}
9
- {%- set role = message['role'] -%}
10
- {%- endif -%}
11
-
12
- {%- if (role == 'user') != (loop.index0 % 2 == 0) -%}
13
- {{ raise_exception("Conversation roles must alternate user/assistant/user/assistant/...") }}
14
- {%- endif -%}
15
-
16
- {{ '<start_of_turn>' + role + '\n' }}
17
- {%- if message['content'] is string -%}
18
- {{ message['content'] | trim }}
19
- {%- elif message['content'] is iterable -%}
20
- {%- for item in message['content'] -%}
21
- {%- if item['type'] == 'image' -%}
22
- {{ '<start_of_image>' }}
23
- {%- elif item['type'] == 'text' -%}
24
- {{ item['text'] | trim }}
25
- {%- endif -%}
26
- {%- endfor -%}
27
- {%- else -%}
28
- {{ raise_exception("Invalid content type") }}
29
- {%- endif -%}
30
- {{ '<end_of_turn>\n' }}
31
- {%- endfor -%}
32
- {%- if add_generation_prompt -%}
33
- {{'<start_of_turn>model\n'}}
34
- {%- endif -%}