Skip to content

Commit 44f8598

Browse files
authored
Fix anima LLM adapter forward when manual cast (Comfy-Org#12504)
1 parent fe52843 commit 44f8598

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

comfy/ldm/anima/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ def forward(self, source_hidden_states, target_input_ids, target_attention_mask=
179179
if source_attention_mask.ndim == 2:
180180
source_attention_mask = source_attention_mask.unsqueeze(1).unsqueeze(1)
181181

182-
x = self.in_proj(self.embed(target_input_ids))
183182
context = source_hidden_states
183+
x = self.in_proj(self.embed(target_input_ids, out_dtype=context.dtype))
184184
position_ids = torch.arange(x.shape[1], device=x.device).unsqueeze(0)
185185
position_ids_context = torch.arange(context.shape[1], device=x.device).unsqueeze(0)
186186
position_embeddings = self.rotary_emb(x, position_ids)

0 commit comments

Comments
 (0)