Don't trim on whitespace user prefix sequence

dedb96ec8d6f99c1ff8742ca4ae039e43b913926

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +2 -1Ignore whitespace
public/script.js+2 -1
@@ -5427,6 +5427,7 @@ export function cleanUpMessage(getMessage, isImpersonate, isContinue, displayInc
54275427 getMessage = getMessage.substring(0, getMessage.indexOf('<|endoftext|>'));
54285428 }
54295429 const isInstruct = power_user.instruct.enabled && main_api !== 'openai';
5430+ const isNotEmpty = (str) => str && str.trim() !== '';
54305431 if (isInstruct && power_user.instruct.stop_sequence) {
54315432 if (getMessage.indexOf(power_user.instruct.stop_sequence) != -1) {
54325433 getMessage = getMessage.substring(0, getMessage.indexOf(power_user.instruct.stop_sequence));
@@ -5434,7 +5435,7 @@ export function cleanUpMessage(getMessage, isImpersonate, isContinue, displayInc
54345435 }
54355436 // Hana: Only use the first sequence (should be <|model|>)
54365437 // of the prompt before <|user|> (as KoboldAI Lite does it).
54375438 if (isInstruct && isNotEmpty(power_user.instruct.input_sequence)) {
54385439 if (getMessage.indexOf(power_user.instruct.input_sequence) != -1) {
54395440 getMessage = getMessage.substring(0, getMessage.indexOf(power_user.instruct.input_sequence));
54405441 }