소스 검색

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

AUTOMATIC1111 1 년 전
부모
커밋
2f6ea8b103
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      javascript/edit-attention.js

+ 2 - 0
javascript/edit-attention.js

@@ -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;