mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 16:17:57 +01:00
Mixtral Instruct: detect prompt format for llama.cpp loader
Workaround until the tokenizer.chat_template kv field gets implemented
This commit is contained in:
parent
3bbf6c601d
commit
a060908d6c
@ -1,16 +1,7 @@
|
|||||||
instruction_template: |-
|
instruction_template: |-
|
||||||
{%- set found_item = false -%}
|
|
||||||
{%- for message in messages -%}
|
|
||||||
{%- if message['role'] == 'system' -%}
|
|
||||||
{%- set found_item = true -%}
|
|
||||||
{%- endif -%}
|
|
||||||
{%- endfor -%}
|
|
||||||
{%- if not found_item -%}
|
|
||||||
{{- '' + '' + '' -}}
|
|
||||||
{%- endif %}
|
|
||||||
{%- for message in messages %}
|
{%- for message in messages %}
|
||||||
{%- if message['role'] == 'system' -%}
|
{%- if message['role'] == 'system' -%}
|
||||||
{{- '' + message['content'] + '' -}}
|
{{- message['content'] -}}
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
{%- if message['role'] == 'user' -%}
|
{%- if message['role'] == 'user' -%}
|
||||||
{{-'[INST] ' + message['content'] + ' [/INST]'-}}
|
{{-'[INST] ' + message['content'] + ' [/INST]'-}}
|
||||||
|
@ -174,7 +174,7 @@
|
|||||||
instruction_template: 'OpenChat'
|
instruction_template: 'OpenChat'
|
||||||
.*codellama.*instruct:
|
.*codellama.*instruct:
|
||||||
instruction_template: 'Llama-v2'
|
instruction_template: 'Llama-v2'
|
||||||
.*mistral.*instruct:
|
.*(mistral|mixtral).*instruct:
|
||||||
instruction_template: 'Mistral'
|
instruction_template: 'Mistral'
|
||||||
.*mistral.*openorca:
|
.*mistral.*openorca:
|
||||||
instruction_template: 'ChatML'
|
instruction_template: 'ChatML'
|
||||||
|
Loading…
Reference in New Issue
Block a user