Commit 2f6ea8b1 authored by AUTOMATIC1111's avatar AUTOMATIC1111
Browse files

respect keyedit_precision_attention setting when converting from old (((attention))) syntax

parent a3d9b011
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -86,6 +86,8 @@ function keyupEditAttention(event) {
                weight = (1 / 1.1) ** numParen;
            }

            weight = Math.round(weight / opts.keyedit_precision_attention) * opts.keyedit_precision_attention;

            text = text.slice(0, selectionStart - numParen) + "(" + text.slice(selectionStart, selectionEnd) + ":" + weight + ")" + text.slice(selectionEnd + numParen);
            selectionStart -= numParen - 1;
            selectionEnd -= numParen - 1;