add clip-skip notes

This commit is contained in:
Vladimir Mandic
2024-02-09 14:29:17 -05:00
parent a069a45e6a
commit 40feb79b11
3 changed files with 5 additions and 4 deletions
+2 -1
View File
@@ -240,7 +240,8 @@ class FrozenCLIPEmbedderWithCustomWords(FrozenCLIPEmbedderWithCustomWordsBase):
return tokenized
def encode_with_transformers(self, tokens):
clip_skip = opts.data['clip_skip'] or 1
clip_skip = int(opts.data['clip_skip']) or 1
print('HERE', type(clip_skip), clip_skip)
outputs = self.wrapped.transformer(input_ids=tokens, output_hidden_states=-clip_skip)
if clip_skip > 1:
z = outputs.hidden_states[-clip_skip]