Update modeling_quiet.py
Browse files- modeling_quiet.py +5 -0
modeling_quiet.py
CHANGED
@@ -955,6 +955,11 @@ class QuietModel(QuietPreTrainedModel):
|
|
955 |
|
956 |
thought_ids.append(thought_id.squeeze(0))
|
957 |
thought_embeddings.append(thought_embedding.squeeze(0))
|
|
|
|
|
|
|
|
|
|
|
958 |
|
959 |
return thought_ids, thought_embeddings
|
960 |
|
|
|
955 |
|
956 |
thought_ids.append(thought_id.squeeze(0))
|
957 |
thought_embeddings.append(thought_embedding.squeeze(0))
|
958 |
+
seq_length = hidden_states.size(1)
|
959 |
+
thought_embeddings = [
|
960 |
+
torch.nn.functional.pad(emb, (0, 0, 0, seq_length - emb.size(0)), mode='constant', value=0)[:seq_length]
|
961 |
+
for emb in thought_embeddings
|
962 |
+
]
|
963 |
|
964 |
return thought_ids, thought_embeddings
|
965 |
|