hyoungwoncho
commited on
Commit
•
93b6af7
1
Parent(s):
592e9f9
Update pipeline.py
Browse filesHi, 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!
- 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 |
-
|
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 |
|