Allow LoRA strengths between -2 and 2

This commit is contained in:
Olivia Godone-Maresca
2023-06-03 14:54:17 -04:00
parent 6ca7247c02
commit 401fc30617
3 changed files with 10 additions and 10 deletions

View File

@ -402,12 +402,12 @@ function debounce(func, wait, immediate) {
function preventNonNumericalInput(e) {
e = e || window.event
let charCode = typeof e.which == "undefined" ? e.keyCode : e.which
let charStr = String.fromCharCode(charCode)
let re = e.target.getAttribute("pattern") || "^[0-9]+$"
re = new RegExp(re)
const charCode = typeof e.which == "undefined" ? e.keyCode : e.which
const charStr = String.fromCharCode(charCode)
const newInputValue = `${e.target.value}${charStr}`
const re = new RegExp(e.target.getAttribute("pattern") || "^[0-9]+$")
if (!charStr.match(re)) {
if (!re.test(charStr) && !re.test(newInputValue)) {
e.preventDefault()
}
}