handle clip_skip is none

This commit is contained in:
Vladimir Mandic
2023-04-28 09:28:59 -04:00
parent f9d636e427
commit 57241e256a
+2
View File
@@ -295,6 +295,8 @@ class FrozenCLIPEmbedderWithCustomWords(FrozenCLIPEmbedderWithCustomWordsBase):
return tokenized
def encode_with_transformers(self, tokens):
if opts.CLIP_stop_at_last_layers is None:
opts.CLIP_stop_at_last_layers = 1
outputs = self.wrapped.transformer(input_ids=tokens, output_hidden_states=-opts.CLIP_stop_at_last_layers)
if opts.CLIP_stop_at_last_layers > 1: