Merge branch 'main' into bugfix/save-intermediates

This commit is contained in:
Lincoln Stein
2023-02-20 12:51:53 -05:00
committed by GitHub
17 changed files with 200 additions and 87 deletions

View File

@ -1391,3 +1391,7 @@ def check_internet() -> bool:
return True
except:
return False
if __name__ == '__main__':
main()

View File

@ -584,7 +584,9 @@ class SlicedSwapCrossAttnProcesser(SlicedAttnProcessor):
# print(f"SwapCrossAttnContext for {attention_type} active")
batch_size, sequence_length, _ = hidden_states.shape
attention_mask = attn.prepare_attention_mask(attention_mask, sequence_length)
attention_mask = attn.prepare_attention_mask(
attention_mask=attention_mask, target_length=sequence_length,
batch_size=batch_size)
query = attn.to_q(hidden_states)
dim = query.shape[-1]

View File

@ -84,7 +84,7 @@ class TextualInversionManager:
return
elif (
self.text_encoder.get_input_embeddings().weight.data[0].shape[0]
!= embedding_info["embedding"].shape[0]
!= embedding_info['token_dim']
):
print(
f"** Notice: {ckpt_path.parents[0].name}/{ckpt_path.name} was trained on a model with a different token dimension. It can't be used with this model."