File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
fastvideo/pipelines/stages Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,16 @@ def forward(
116116 with open ("/workspace/FastVideo/fastvideo_hidden_states.log" , "a" ) as f :
117117 f .write (f"TextEncodingStage: negative_prompt_embeds sum = { sum_value :.6f} \n " )
118118
119+ # Apply attention mask length processing (like Diffusers does)
120+ lengths = negative_attention_mask .sum (dim = 1 ).cpu ()
121+ for i , length in enumerate (lengths ):
122+ negative_prompt_embeds [i , length :] = 0
123+
124+ sum_value = negative_prompt_embeds .float ().sum ().item ()
125+ logger .info (f"TextEncodingStage: negative_prompt_embeds sum after masking = { sum_value :.6f} " )
126+ with open ("/workspace/FastVideo/fastvideo_hidden_states.log" , "a" ) as f :
127+ f .write (f"TextEncodingStage: negative_prompt_embeds sum after masking = { sum_value :.6f} \n " )
128+
119129 assert batch .negative_prompt_embeds is not None
120130 batch .negative_prompt_embeds .append (negative_prompt_embeds )
121131 if batch .negative_attention_mask is not None :
You can’t perform that action at this time.
0 commit comments