Crystalcareai commited on
Commit
3ba81a3
·
verified ·
1 Parent(s): eaa31dc

Update modeling_quiet.py

Browse files
Files changed (1) hide show
  1. modeling_quiet.py +2 -0
modeling_quiet.py CHANGED
@@ -2174,6 +2174,8 @@ class QuietForCausalLM(QuietPreTrainedModel, GenerationMixin):
2174
 
2175
  if attention_mask is None:
2176
  attention_mask = torch.ones_like(input_ids)
 
 
2177
 
2178
  if self.use_start_thought_token:
2179
  start_thought_token_id = self.tokenizer.convert_tokens_to_ids("<|startthought|>")
 
2174
 
2175
  if attention_mask is None:
2176
  attention_mask = torch.ones_like(input_ids)
2177
+ else:
2178
+ attention_mask = attention_mask[:, -input_ids.shape[1]:] # Adjust the attention mask size
2179
 
2180
  if self.use_start_thought_token:
2181
  start_thought_token_id = self.tokenizer.convert_tokens_to_ids("<|startthought|>")