openfree commited on
Commit
6ab32bd
·
verified ·
1 Parent(s): 85ad908

Update sonic.py

Browse files
Files changed (1) hide show
  1. sonic.py +3 -5
sonic.py CHANGED
@@ -89,13 +89,11 @@ def test(
89
  pad = torch.zeros_like(cond_clip[:, :, : 10 - cond_clip.shape[2]])
90
  cond_clip = torch.cat([cond_clip, pad], dim=2)
91
 
92
- bucket_clip = last_prompts[:, start : start + 50]
93
- if bucket_clip.shape[2] < 50: # [★ 수정] 패딩
94
- pad = torch.zeros_like(bucket_clip[:, :, : 50 - bucket_clip.shape[2]])
95
- bucket_clip = torch.cat([bucket_clip, pad], dim=2)
96
-
97
  motion = audio2bucket(bucket_clip, image_embeds) * 16 + 16
98
 
 
99
  ref_list.append(ref_img[0])
100
  audio_list.append(audio_pe(cond_clip).squeeze(0)[0])
101
  uncond_list.append(audio_pe(torch.zeros_like(cond_clip)).squeeze(0)[0])
 
89
  pad = torch.zeros_like(cond_clip[:, :, : 10 - cond_clip.shape[2]])
90
  cond_clip = torch.cat([cond_clip, pad], dim=2)
91
 
92
+ bucket_clip = last_prompts[:, start : start + 50] # (1 , 50 , 384)
93
+ bucket_clip = bucket_clip.unsqueeze(0).unsqueeze(-2) # (1 , 1 , 50 , 1 , 384) ✔
 
 
 
94
  motion = audio2bucket(bucket_clip, image_embeds) * 16 + 16
95
 
96
+
97
  ref_list.append(ref_img[0])
98
  audio_list.append(audio_pe(cond_clip).squeeze(0)[0])
99
  uncond_list.append(audio_pe(torch.zeros_like(cond_clip)).squeeze(0)[0])