feat: match anything in array syntax, not only words and whitespace (#2438)

allows e.g. [[ (red:1.1), (blue:1.2) ]] and enables same seed checks for different prompt weight
This commit is contained in:
Manuel Schmid 2024-03-04 11:22:24 +01:00 committed by GitHub
parent e54fb54f91
commit 9155d94067
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 2 deletions

View File

@ -94,9 +94,8 @@ def get_words(arrays, totalMult, index):
return [word] + get_words(arrays[1:], math.floor(totalMult/len(words)), index)
def apply_arrays(text, index):
arrays = re.findall(r'\[\[([\s,\w-]+)\]\]', text)
arrays = re.findall(r'\[\[(.*?)\]\]', text)
if len(arrays) == 0:
return text