Crystalcareai commited on
Commit
7621f1c
·
verified ·
1 Parent(s): 37c4611

Update modeling_quiet.py

Browse files
Files changed (1) hide show
  1. 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