@@ -702,7 +702,8 @@ def forward(
702702 packed_tokens_vision , original_latent_shapes = self ._patchify_and_pack_latents (vision_tokens )
703703 packed_tokens_vision = self .proj_in (packed_tokens_vision )
704704 timesteps_vision = vision_timesteps * self .config .timestep_scale
705- packed_timestep_embeds_vision = self .time_embedder (self .time_proj (timesteps_vision ))
705+ time_embedder_dtype = next (self .time_embedder .parameters ()).dtype
706+ packed_timestep_embeds_vision = self .time_embedder (self .time_proj (timesteps_vision ).to (time_embedder_dtype ))
706707 packed_timestep_embeds_vision = packed_timestep_embeds_vision .to (target_dtype )
707708 packed_tokens_vision = self ._apply_timestep_embeds_to_noisy_tokens (
708709 packed_tokens = packed_tokens_vision ,
@@ -717,7 +718,7 @@ def forward(
717718 packed_tokens_sound = self ._pack_sound_latents (sound_tokens , sound_token_shapes ).to (target_dtype )
718719 packed_tokens_sound = self .audio_proj_in (packed_tokens_sound ) + self .audio_modality_embed
719720 timesteps_sound = sound_timesteps * self .config .timestep_scale
720- packed_timestep_embeds_sound = self .time_embedder (self .time_proj (timesteps_sound ))
721+ packed_timestep_embeds_sound = self .time_embedder (self .time_proj (timesteps_sound ). to ( time_embedder_dtype ) )
721722 packed_timestep_embeds_sound = packed_timestep_embeds_sound .to (target_dtype )
722723 packed_tokens_sound = self ._apply_timestep_embeds_to_noisy_tokens (
723724 packed_tokens = packed_tokens_sound ,
@@ -738,7 +739,9 @@ def forward(
738739 packed_tokens_action = packed_tokens_action + self .action_modality_embed
739740 if action_mse_loss_indexes .numel () > 0 :
740741 timesteps_action = action_timesteps * self .config .timestep_scale
741- packed_timestep_embeds_action = self .time_embedder (self .time_proj (timesteps_action ))
742+ packed_timestep_embeds_action = self .time_embedder (
743+ self .time_proj (timesteps_action ).to (time_embedder_dtype )
744+ )
742745 packed_timestep_embeds_action = packed_timestep_embeds_action .to (target_dtype )
743746 packed_tokens_action = self ._apply_timestep_embeds_to_noisy_tokens (
744747 packed_tokens = packed_tokens_action ,
0 commit comments