From b65279ea279db3d615ebfa4d224ca0d6d0cfbab4 Mon Sep 17 00:00:00 2001 From: SillyLossy Date: Mon, 15 May 2023 17:42:18 +0300 Subject: [PATCH] Adjust stopping strings for metharme --- public/script.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/public/script.js b/public/script.js index 281bda8a0..68ed89267 100644 --- a/public/script.js +++ b/public/script.js @@ -1261,15 +1261,16 @@ function getStoppingStrings(isImpersonate, addSpace) { } } + // Cohee: oobabooga's textgen always appends newline before the sequence as a stopping string + // But it's a problem for Metharme which doesn't use newlines to separate them. + const wrap = (s) => power_user.instruct.wrap ? '\n' + s : s; + if (power_user.instruct.enabled) { - // Cohee: This was borrowed from oobabooga's textgen. But.. - // What if a model doesn't use newlines to chain sequences? - // Who knows. if (power_user.instruct.input_sequence) { - result.push(`\n${power_user.instruct.input_sequence}`); + result.push(wrap(power_user.instruct.input_sequence)); } if (power_user.instruct.output_sequence) { - result.push(`\n${power_user.instruct.output_sequence}`); + result.push(wrap(power_user.instruct.output_sequence)); } }