From c44836c4d7a86703004b892f3d652903fc488f89 Mon Sep 17 00:00:00 2001 From: Badis Ghoubali <110173477+BadisG@users.noreply.github.com> Date: Wed, 10 Jan 2024 01:12:54 +0100 Subject: [PATCH] Fix spaces in Mistral/Mixtral instruct prompt (#5214) --- instruction-templates/Mistral.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/instruction-templates/Mistral.yaml b/instruction-templates/Mistral.yaml index 0b6baf11..113c238b 100644 --- a/instruction-templates/Mistral.yaml +++ b/instruction-templates/Mistral.yaml @@ -4,13 +4,12 @@ instruction_template: |- {{- message['content'] -}} {%- else -%} {%- if message['role'] == 'user' -%} - {{-'[INST] ' + message['content'] + ' [/INST]'-}} + {{-' [INST] ' + message['content'].rstrip() + ' [/INST] '-}} {%- else -%} - {{-'' + message['content'] + ' ' -}} + {{-'' + message['content'] + '' -}} {%- endif -%} {%- endif -%} {%- endfor -%} {%- if add_generation_prompt -%} {{-''-}} - {%- endif -%} - + {%- endif -%} \ No newline at end of file