From 682f0986d920deaf783fd9a494c51237b4130d67 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sun, 1 Jan 2023 00:58:14 +0100 Subject: Fix --- models/clip/tokenizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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): if id in self.token_map: tokens = self.token_map[id] - if vector_shuffle: + if vector_shuffle and len(tokens) > 2: subtokens = tokens[1:-1] np.random.shuffle(subtokens) tokens = tokens[:1] + subtokens + tokens[-1:] -- cgit v1.2.3-70-g09d2