Format instruct mode examples

This commit is contained in:
Stefan Daniel Schwarz
2023-08-20 22:03:45 +02:00
parent 090e7c5a6a
commit f5d5b2f749
2 changed files with 24 additions and 0 deletions

View File

@@ -66,6 +66,7 @@ import {
pygmalion_options,
tokenizers,
formatInstructModeChat,
formatInstructModeExamples,
formatInstructModePrompt,
persona_description_positions,
loadMovingUIState,
@@ -2542,6 +2543,9 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
if (mesExamples.replace(/<START>/gi, '').trim().length === 0) {
mesExamples = '';
}
if (mesExamples && isInstruct) {
mesExamples = formatInstructModeExamples(mesExamples, name1, name2)
}
const exampleSeparator = power_user.context.example_separator ? `${power_user.context.example_separator}\n` : '';
const blockHeading = main_api === 'openai' ? '<START>\n' : exampleSeparator;