Merge pull request #1095 from GanstaKingofSA/release

Improved cleanup for Instruct Mode (Release)
This commit is contained in:
Cohee 2023-09-05 10:58:21 +03:00 committed by GitHub
commit 56b78a8227
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -3800,6 +3800,13 @@ function cleanUpMessage(getMessage, isImpersonate, isContinue, displayIncomplete
getMessage = getMessage.substring(0, getMessage.indexOf(power_user.instruct.stop_sequence));
}
}
// Hana: Only use the first sequence (should be <|model|>)
// of the prompt before <|user|> (as KoboldAI Lite does it).
if (isInstruct && power_user.instruct.input_sequence) {
if (getMessage.indexOf(power_user.instruct.input_sequence) != -1) {
getMessage = getMessage.substring(0, getMessage.indexOf(power_user.instruct.input_sequence));
}
}
if (isInstruct && power_user.instruct.input_sequence && isImpersonate) {
//getMessage = getMessage.replaceAll(power_user.instruct.input_sequence, '');
power_user.instruct.input_sequence.split('\n')