hyoungwoncho commited on
Commit
93b6af7
1 Parent(s): 592e9f9

Update pipeline.py

Browse files

Hi, I'm [Hyoungwon Cho](https://huggingface.co/hyoungwoncho), author of Perturbed-Attention Guidance. There was an error in implementation, so I corrected that part. I'd appreciate it if you could reflect it. Thank you!

Files changed (1) hide show
  1. pipeline.py +2 -2
pipeline.py CHANGED
@@ -157,8 +157,8 @@ class PAGIdentitySelfAttnProcessor:
157
 
158
  value = attn.to_v(hidden_states_ptb)
159
 
160
- hidden_states_ptb = torch.zeros(value.shape).to(value.get_device())
161
- #hidden_states_ptb = value
162
 
163
  hidden_states_ptb = hidden_states_ptb.to(query.dtype)
164
 
 
157
 
158
  value = attn.to_v(hidden_states_ptb)
159
 
160
+ # hidden_states_ptb = torch.zeros(value.shape).to(value.get_device())
161
+ hidden_states_ptb = value
162
 
163
  hidden_states_ptb = hidden_states_ptb.to(query.dtype)
164