Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modified for dynamic batch size in sample #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions soundstorm/s2/engine/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def sample(self,
# only save the wav of first 5 in batch
# target wav in batch is reverse sorted with length
audio_indexs = []
for i in range(10):
for i in range(min(10,content_gt.size(0))):
save_name_gt_wav = save_path + '/gt_' + str(i) + '.wav'
acoustic_token_gt = codes_np_gt[i]
# all Nq have same pad length
Expand Down Expand Up @@ -300,7 +300,7 @@ def sample(self,
# self.hificodec
np.save(save_name, codes_np)
if gen_audio:
for i in range(10):
for i in range(min(10,codes.size(0))):
save_name_wav = save_path + name_prefix + '_' + str(
i) + '.wav'
acoustic_token = codes_np[i]
Expand Down