fix several bad chat templates (#3250)

Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
Jared Van Bortel
2024-12-10 12:06:26 -05:00
committed by GitHub
parent 6f49984a29
commit 11f57afc58
3 changed files with 12 additions and 6 deletions

View File

@@ -53,7 +53,9 @@ static const QStringList FILENAME_BLACKLIST { u"gpt4all-nomic-embed-text-v1.rmod
static const QString RMODEL_CHAT_TEMPLATE = uR"(<chat>
{%- set loop_messages = messages %}
{%- for message in loop_messages %}
{{- raise_exception('Unknown role: ' + messages['role']) }}
{%- if not message['role'] in ['user', 'assistant', 'system'] %}
{{- raise_exception('Unknown role: ' + message['role']) }}
{%- endif %}
{{- '<' + message['role'] + '>' }}
{%- if message['role'] == 'user' %}
{%- for source in message.sources %}