(self, input_dim, output_dim)
| 30 | |
| 31 | class IpAdapterModule(torch.nn.Module): |
| 32 | def __init__(self, input_dim, output_dim): |
| 33 | super().__init__() |
| 34 | self.to_k_ip = torch.nn.Linear(input_dim, output_dim, bias=False) |
| 35 | self.to_v_ip = torch.nn.Linear(input_dim, output_dim, bias=False) |
| 36 | |
| 37 | def forward(self, hidden_states): |
| 38 | ip_k = self.to_k_ip(hidden_states) |