mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-08-11 04:41:54 +00:00
add template replacement for OLMoE-1B-7B-0125
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
parent
df95b7b0a4
commit
62fbe796c4
@ -7,7 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Substitute prettier default templates for OLMoE 7B and Granite 3.1 3B/8B ([#3471](https://github.com/nomic-ai/gpt4all/pull/3471))
|
- Substitute prettier default templates for OLMoE 7B 0924/0125 and Granite 3.1 3B/8B ([#3471](https://github.com/nomic-ai/gpt4all/pull/3471))
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Fix several potential crashes ([#3465](https://github.com/nomic-ai/gpt4all/pull/3465))
|
- Fix several potential crashes ([#3465](https://github.com/nomic-ai/gpt4all/pull/3465))
|
||||||
|
@ -638,6 +638,37 @@ const std::unordered_map<std::string_view, std::string_view> CHAT_TEMPLATE_SUBST
|
|||||||
{%- if add_generation_prompt %}
|
{%- if add_generation_prompt %}
|
||||||
{{- '<|im_start|>assistant\n' }}
|
{{- '<|im_start|>assistant\n' }}
|
||||||
{%- endif %})TEMPLATE",
|
{%- endif %})TEMPLATE",
|
||||||
|
},
|
||||||
|
// OLMoE-1B-7B-0125-Instruct-Q4_0.gguf (nomic-ai/gpt4all#3471)
|
||||||
|
{
|
||||||
|
// original
|
||||||
|
R"TEMPLATE({{ bos_token }}{% for message in messages %}{% if message['role'] == 'system' %}{{ '<|system|>
|
||||||
|
' + message['content'] + '
|
||||||
|
' }}{% elif message['role'] == 'user' %}{{ '<|user|>
|
||||||
|
' + message['content'] + '
|
||||||
|
' }}{% elif message['role'] == 'assistant' %}{% if not loop.last %}{{ '<|assistant|>
|
||||||
|
' + message['content'] + eos_token + '
|
||||||
|
' }}{% else %}{{ '<|assistant|>
|
||||||
|
' + message['content'] + eos_token }}{% endif %}{% endif %}{% if loop.last and add_generation_prompt %}{{ '<|assistant|>
|
||||||
|
' }}{% endif %}{% endfor %})TEMPLATE",
|
||||||
|
// replacement
|
||||||
|
R"TEMPLATE({{- bos_token }}
|
||||||
|
{%- for message in messages %}
|
||||||
|
{%- if message['role'] == 'system' %}
|
||||||
|
{{- '<|system|>\n' + message['content'] + '\n' }}
|
||||||
|
{%- elif message['role'] == 'user' %}
|
||||||
|
{{- '<|user|>\n' + message['content'] + '\n' }}
|
||||||
|
{%- elif message['role'] == 'assistant' %}
|
||||||
|
{%- if not loop.last %}
|
||||||
|
{{- '<|assistant|>\n' + message['content'] + eos_token + '\n' }}
|
||||||
|
{%- else %}
|
||||||
|
{{- '<|assistant|>\n' + message['content'] + eos_token }}
|
||||||
|
{%- endif %}
|
||||||
|
{%- endif %}
|
||||||
|
{%- if loop.last and add_generation_prompt %}
|
||||||
|
{{- '<|assistant|>\n' }}
|
||||||
|
{%- endif %}
|
||||||
|
{%- endfor %})TEMPLATE",
|
||||||
},
|
},
|
||||||
// OLMoE-1B-7B-0924-Instruct-Q4_0.gguf (nomic-ai/gpt4all#3471)
|
// OLMoE-1B-7B-0924-Instruct-Q4_0.gguf (nomic-ai/gpt4all#3471)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user