fix bug when there are two multi vector TI in a prompt

This commit is contained in:
woweenie 2023-12-27 22:14:14 +01:00 committed by GitHub
parent 2c632a811b
commit e38d0e39b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -215,7 +215,9 @@ class ModelPatcher:
text_encoder.resize_token_embeddings(init_tokens_count + new_tokens_added, pad_to_multiple_of)
model_embeddings = text_encoder.get_input_embeddings()
for ti_name, _ in ti_list:
for ti_name, ti in ti_list:
ti_embedding = _get_ti_embedding(text_encoder.get_input_embeddings(), ti)
ti_tokens = []
for i in range(ti_embedding.shape[0]):
embedding = ti_embedding[i]