diff options
Diffstat (limited to 'models/clip')
-rw-r--r-- | models/clip/tokenizer.py | 2 |
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:] |