Skip to content

Commit

Permalink
Fix for remote model templates when messages contain xml. (#3318)
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Treat <[email protected]>
Signed-off-by: AT <[email protected]>
Co-authored-by: Jared Van Bortel <[email protected]>
  • Loading branch information
manyoso and cebtenzzre authored Dec 18, 2024
1 parent aa84e2d commit 5ab70da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions gpt4all-chat/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.

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

## [Unreleased]

### Fixed
- Fix remote model template to allow for XML in messages ([#3318](https://github.com/nomic-ai/gpt4all/pull/3318))

## [3.5.3] - 2024-12-16

### Fixed
Expand Down
10 changes: 5 additions & 5 deletions gpt4all-chat/src/modellist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ static const QString RMODEL_CHAT_TEMPLATE = uR"(<chat>
{%- if loop.first %}
{{- '### Context:\n' }}
{%- endif %}
{{- 'Collection: ' + source.collection + '\n' +
'Path: ' + source.path + '\n' +
'Excerpt: ' + source.text + '\n\n' }}
{{- ('Collection: ' + source.collection + '\n' +
'Path: ' + source.path + '\n' +
'Excerpt: ' + source.text + '\n\n') | escape }}
{%- endfor %}
{%- endif %}
{%- for attachment in message.prompt_attachments %}
{{- attachment.processed_content + '\n\n' }}
{{- (attachment.processed_content + '\n\n') | escape }}
{%- endfor %}
{{- message.content }}
{{- message.content | escape }}
{{- '</' + message['role'] + '>' }}
{%- endfor %}
</chat>)"_s;
Expand Down

0 comments on commit 5ab70da

Please sign in to comment.