mirror of
https://github.com/Physton/sd-webui-prompt-all-in-one.git
synced 2026-01-26 19:29:56 +00:00
Fix the issue of BREAK tokenization error
修复BREAK分词错误的问题
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -710,6 +710,10 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
if (tag.value === 'BREAK') {
|
||||
splitSymbol = ' '
|
||||
}
|
||||
|
||||
if (this.autoRemoveLastComma && index + 1 === length) {
|
||||
// 如果是最后一个,那么就不需要加逗号
|
||||
splitSymbol = ''
|
||||
|
||||
@@ -64,7 +64,24 @@ export default (tags) => {
|
||||
endBracketChar = brackets[char]
|
||||
temp += char
|
||||
} else {
|
||||
temp += char
|
||||
if (char === " " && temp.trim() === 'BREAK') {
|
||||
result.push(temp.trim())
|
||||
bracketCount = 0
|
||||
startBracketChar = ''
|
||||
endBracketChar = ''
|
||||
temp = ''
|
||||
} else {
|
||||
temp += char
|
||||
if (temp.endsWith(' BREAK')) {
|
||||
temp = temp.substring(0, temp.length - ' BREAK'.length)
|
||||
result.push(temp.trim())
|
||||
result.push('BREAK')
|
||||
bracketCount = 0
|
||||
startBracketChar = ''
|
||||
endBracketChar = ''
|
||||
temp = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 前面有括号
|
||||
|
||||
Reference in New Issue
Block a user