summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2023-01-01 00:58:14 +0100
committerVolpeon <git@volpeon.ink>2023-01-01 00:58:14 +0100
commit682f0986d920deaf783fd9a494c51237b4130d67 (patch)
treea6cd66ad4d7440e9598fcfe6f34ea777bcc9eeb1
parentBetter token shuffling (diff)
downloadtextual-inversion-diff-682f0986d920deaf783fd9a494c51237b4130d67.tar.gz
textual-inversion-diff-682f0986d920deaf783fd9a494c51237b4130d67.tar.bz2
textual-inversion-diff-682f0986d920deaf783fd9a494c51237b4130d67.zip
Fix
-rw-r--r--models/clip/tokenizer.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/clip/tokenizer.py b/models/clip/tokenizer.py
index 256d442..a3e6e70 100644
--- a/models/clip/tokenizer.py
+++ b/models/clip/tokenizer.py
@@ -46,7 +46,7 @@ class MultiCLIPTokenizer(CLIPTokenizer):
46 if id in self.token_map: 46 if id in self.token_map:
47 tokens = self.token_map[id] 47 tokens = self.token_map[id]
48 48
49 if vector_shuffle: 49 if vector_shuffle and len(tokens) > 2:
50 subtokens = tokens[1:-1] 50 subtokens = tokens[1:-1]
51 np.random.shuffle(subtokens) 51 np.random.shuffle(subtokens)
52 tokens = tokens[:1] + subtokens + tokens[-1:] 52 tokens = tokens[:1] + subtokens + tokens[-1:]