Fix jinja bugs,Reasoning mode is used by default
#2
by
xldistance
- opened
Edit line 34 of jinja
{%- if role is not none and role.class is not none and role not in role_indicators %}
--jinja --chat-template-file H:/Langchain-Chatchat0.3/chat_template.jinja
I can confirm the fix @xldistance suggested is working:
37
38 {% for i in range(messages | length) %}
39 {% set msg = messages[i] %}
40 {% set role = msg.role %}
41 - {% if role not in role_indicators %}
41 + {% if role is not none and role.class is not none and role not in role_indicators %}
42 {{ raise_exception('Unknown role: ' ~ role) }}
43 {% endif %}