trias702 commited on
Commit
0820ac4
·
1 Parent(s): abf48b3

Changed chat_template to remove alternating check

Browse files

Signed-off-by: Daniel Egert <degert@nvidia.com>

Files changed (1) hide show
  1. chat_template.jinja +0 -10
chat_template.jinja CHANGED
@@ -33,16 +33,6 @@
33
  {%- set tools_definition = '[AVAILABLE_TOOLS]' + (tools| tojson) + '[/AVAILABLE_TOOLS]' %}
34
  {{- tools_definition }}
35
  {%- endif %}
36
- {#- Checks for alternating user/assistant messages. #}
37
- {%- set ns = namespace(index=0) %}
38
- {%- for message in loop_messages %}
39
- {%- if message.role == 'user' or (message.role == 'assistant' and (message.tool_calls is not defined or message.tool_calls is none or message.tool_calls | length == 0)) %}
40
- {%- if (message['role'] == 'user') != (ns.index % 2 == 0) %}
41
- {{- raise_exception('After the optional system message, conversation roles must alternate user and assistant roles except for tool calls and results.') }}
42
- {%- endif %}
43
- {%- set ns.index = ns.index + 1 %}
44
- {%- endif %}
45
- {%- endfor %}
46
  {#- Handle conversation messages. #}
47
  {%- for message in loop_messages %}
48
  {#- User messages supports text content or text and image chunks. #}
 
33
  {%- set tools_definition = '[AVAILABLE_TOOLS]' + (tools| tojson) + '[/AVAILABLE_TOOLS]' %}
34
  {{- tools_definition }}
35
  {%- endif %}
 
 
 
 
 
 
 
 
 
 
36
  {#- Handle conversation messages. #}
37
  {%- for message in loop_messages %}
38
  {#- User messages supports text content or text and image chunks. #}