Spaces:
Runtime error
Runtime error
Download mimicmotion/utils/geglu_patch.py from dsdad/MimicMotion: direct link, hf CLI and curl.
- Browser
- Download file 353 Bytes
-
https://huggingface.co/spaces/dsdad/MimicMotion/resolve/main/mimicmotion/utils/geglu_patch.py
- Command line
-
hf download hf://spaces/dsdad/MimicMotion/mimicmotion/utils/geglu_patch.py
-
curl -L -o geglu_patch.py https://huggingface.co/spaces/dsdad/MimicMotion/resolve/main/mimicmotion/utils/geglu_patch.py
353 Bytes
| import diffusers.models.activations | |
| def patch_geglu_inplace(): | |
| """Patch GEGLU with inplace multiplication to save GPU memory.""" | |
| def forward(self, hidden_states): | |
| hidden_states, gate = self.proj(hidden_states).chunk(2, dim=-1) | |
| return hidden_states.mul_(self.gelu(gate)) | |
| diffusers.models.activations.GEGLU.forward = forward | |