mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fixing Mistral Templates (#2883)
* Update Mistral.json * Rename Mistral.json to Mistral V1.json * Create Mistral V2 & V3.json * Create Mistral V3-Tekken.json * Update and rename Mistral.json to Mistral V1.json * Update Mistral V1.json * Update Mistral V2 & V3.json * Update Mistral V2 & V3.json * Update Mistral V3-Tekken.json * Update Mistral V1.json * Create Mistral V2 & V3.json * Create Mistral V3-Tekken.json * Update Mistral V1.json * Update Mistral V2 & V3.json * Update Mistral V3-Tekken.json * Update Mistral V1.json * Update Mistral V2 & V3.json * Update Mistral V3-Tekken.json * Update Mistral V1.json * Update Mistral V2 & V3.json * Update Mistral V1.json * Update Mistral V3-Tekken.json * Update Mistral V1.json * Update Mistral V2 & V3.json * Update Mistral V3-Tekken.json * Add to content index * Remove example separators * Simplify context fillers * Add a hack for proper V1 format with names * Readability --------- Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
This commit is contained in:
@ -532,6 +532,19 @@ export function formatInstructModePrompt(name, isImpersonate, promptBias, name1,
|
||||
}
|
||||
|
||||
let sequence = getSequence() || '';
|
||||
let nameFiller = '';
|
||||
|
||||
// A hack for Mistral's formatting that has a normal output sequence ending with a space
|
||||
if (
|
||||
includeNames &&
|
||||
power_user.instruct.last_output_sequence &&
|
||||
power_user.instruct.output_sequence &&
|
||||
sequence === power_user.instruct.last_output_sequence &&
|
||||
/\s$/.test(power_user.instruct.output_sequence) &&
|
||||
!/\s$/.test(power_user.instruct.last_output_sequence)
|
||||
) {
|
||||
nameFiller = power_user.instruct.output_sequence.slice(-1);
|
||||
}
|
||||
|
||||
if (power_user.instruct.macro) {
|
||||
sequence = substituteParams(sequence, name1, name2);
|
||||
@ -539,7 +552,7 @@ export function formatInstructModePrompt(name, isImpersonate, promptBias, name1,
|
||||
}
|
||||
|
||||
const separator = power_user.instruct.wrap ? '\n' : '';
|
||||
let text = includeNames ? (separator + sequence + separator + `${name}:`) : (separator + sequence);
|
||||
let text = includeNames ? (separator + sequence + separator + nameFiller + `${name}:`) : (separator + sequence);
|
||||
|
||||
// Quiet prompt already has a newline at the end
|
||||
if (isQuiet && separator) {
|
||||
|
Reference in New Issue
Block a user