From 600f81020a056a14b0e7d63a396c5b5464131ac5 Mon Sep 17 00:00:00 2001 From: machineuser Date: Mon, 28 Apr 2025 07:15:36 +0000 Subject: [PATCH] ollama update 2025-04-28 --- .../ollama-utils/src/chat-template-automap.ts | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/packages/ollama-utils/src/chat-template-automap.ts b/packages/ollama-utils/src/chat-template-automap.ts index 2a18d18eef..58c878cb4e 100644 --- a/packages/ollama-utils/src/chat-template-automap.ts +++ b/packages/ollama-utils/src/chat-template-automap.ts @@ -5,8 +5,20 @@ import type { OllamaChatTemplateMapEntry } from "./types"; /** * Skipped these models due to error: - * - library/llama3:70b - * - library/mistrallite:7b + * - library/gemma3:12b + * - library/llama3.3:70b-instruct-fp16 + * - library/llama3.3:70b + * - library/llama3.1:8b + * - library/llama3.1:70b + * - library/llama3.1:8b-instruct-fp16 + * - library/llama3.2-vision:11b + * - library/mistral-nemo:12b-instruct-2407-q2_K + * - library/llava:34b + * - library/deepcoder:1.5b-preview-fp16 + * - library/firefunction-v2:70b + * - library/yi-coder:1.5b-base-fp16 + * - library/tulu3:70b + * - library/command-a:111b-03-2025-fp16 */ export const OLLAMA_CHAT_TEMPLATE_MAPPING: OllamaChatTemplateMapEntry[] = [ @@ -756,6 +768,17 @@ export const OLLAMA_CHAT_TEMPLATE_MAPPING: OllamaChatTemplateMapEntry[] = [ }, }, }, + { + model: "library/mistral:7b-instruct-fp16", + gguf: "{{ bos_token }}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if message['role'] == 'user' %}{{ '[INST] ' + message['content'] + ' [/INST]' }}{% elif message['role'] == 'assistant' %}{{ message['content'] + eos_token + ' ' }}{% else %}{{ raise_exception('Only user and assistant roles are supported!') }}{% endif %}{% endfor %}", + ollama: { + template: "[INST] {{ .System }} {{ .Prompt }} [/INST]\n", + tokens: ["[INST]"], + params: { + stop: ["[INST]", "[/INST]"], + }, + }, + }, { model: "library/mixtral:8x22b", gguf: "{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content'] %}\n {%- set loop_messages = messages[1:] %}\n{%- else %}\n {%- set loop_messages = messages %}\n{%- endif %}\n\n{{- bos_token }}\n{%- for message in loop_messages %}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}\n {{- raise_exception('After the optional system message, conversation roles must alternate user/assistant/user/assistant/...') }}\n {%- endif %}\n {%- if message['role'] == 'user' %}\n {%- if loop.last and system_message is defined %}\n {{- '[INST] ' + system_message + '\\n\\n' + message['content'] + '[/INST]' }}\n {%- else %}\n {{- '[INST] ' + message['content'] + '[/INST]' }}\n {%- endif %}\n {%- elif message['role'] == 'assistant' %}\n {{- ' ' + message['content'] + eos_token}}\n {%- else %}\n {{- raise_exception('Only user and assistant roles are supported, with the exception of an initial optional system message!') }}\n {%- endif %}\n{%- endfor %}\n",