Fix clipmodel object has no attribute t5xxl bug #494

This commit is contained in:
yolain
2024-10-27 21:05:32 +08:00
parent 5aaaaffa2e
commit ede22dfa27
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -354,7 +354,7 @@ def advanced_encode(clip, text, token_normalization, weight_interpretation, w_ma
pooled = torch.cat((l_pooled, g_pooled), dim=-1)
# t5xxl
if 't5xxl' in tokenized and clip.cond_stage_model.t5xxl is not None:
if 't5xxl' in tokenized:
t5_out, t5_pooled = advanced_encode_from_tokens(tokenized['t5xxl'],
token_normalization,
weight_interpretation,
+1 -1
View File
@@ -29,7 +29,7 @@ def prompt_to_cond(type, model, clip, clip_skip, lora_stack, text, prompt_token_
clipped = clip.clone()
# 当clip模型不存在t5xxl时,可执行跳过层
if clip.cond_stage_model.t5xxl is None:
if not hasattr(clip.cond_stage_model, 't5xxl'):
if clip_skip != 0:
clipped.clip_layer(clip_skip)