Skip to content

Commit 5ab70da

Browse files
manyosocebtenzzre
andauthored
Fix for remote model templates when messages contain xml. (#3318)
Signed-off-by: Adam Treat <[email protected]> Signed-off-by: AT <[email protected]> Co-authored-by: Jared Van Bortel <[email protected]>
1 parent aa84e2d commit 5ab70da

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

gpt4all-chat/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

7+
## [Unreleased]
8+
9+
### Fixed
10+
- Fix remote model template to allow for XML in messages ([#3318](https://github.com/nomic-ai/gpt4all/pull/3318))
11+
712
## [3.5.3] - 2024-12-16
813

914
### Fixed

gpt4all-chat/src/modellist.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ static const QString RMODEL_CHAT_TEMPLATE = uR"(<chat>
6262
{%- if loop.first %}
6363
{{- '### Context:\n' }}
6464
{%- endif %}
65-
{{- 'Collection: ' + source.collection + '\n' +
66-
'Path: ' + source.path + '\n' +
67-
'Excerpt: ' + source.text + '\n\n' }}
65+
{{- ('Collection: ' + source.collection + '\n' +
66+
'Path: ' + source.path + '\n' +
67+
'Excerpt: ' + source.text + '\n\n') | escape }}
6868
{%- endfor %}
6969
{%- endif %}
7070
{%- for attachment in message.prompt_attachments %}
71-
{{- attachment.processed_content + '\n\n' }}
71+
{{- (attachment.processed_content + '\n\n') | escape }}
7272
{%- endfor %}
73-
{{- message.content }}
73+
{{- message.content | escape }}
7474
{{- '</' + message['role'] + '>' }}
7575
{%- endfor %}
7676
</chat>)"_s;

0 commit comments

Comments
 (0)