Spaces:
Running
Running
Commit
·
934d0f3
1
Parent(s):
d794146
debug threads
Browse files
pvq_manipulation/models/vits.py
CHANGED
@@ -247,8 +247,10 @@ class Vits_NT(Vits):
|
|
247 |
)
|
248 |
|
249 |
print('cuda available: ', torch.cuda.is_available())
|
|
|
|
|
250 |
if not torch.cuda.is_available():
|
251 |
-
num_chunks =
|
252 |
chunk_size = z.shape[-1] // num_chunks
|
253 |
z_chunks = torch.split(z, chunk_size, dim=-1)
|
254 |
|
@@ -269,6 +271,8 @@ class Vits_NT(Vits):
|
|
269 |
(z * y_mask)[:, :, : self.max_inference_len],
|
270 |
g=speaker_embedding_man[:, :, None] if self.config.gan_speaker_conditioning else None
|
271 |
)
|
|
|
|
|
272 |
return o
|
273 |
|
274 |
def forward(self, x, x_lengths, y, y_lengths, aux_input, inference=False):
|
|
|
247 |
)
|
248 |
|
249 |
print('cuda available: ', torch.cuda.is_available())
|
250 |
+
import time
|
251 |
+
start = time.time()
|
252 |
if not torch.cuda.is_available():
|
253 |
+
num_chunks = min(os.cpu_count() or 2, z.shape[-1])
|
254 |
chunk_size = z.shape[-1] // num_chunks
|
255 |
z_chunks = torch.split(z, chunk_size, dim=-1)
|
256 |
|
|
|
271 |
(z * y_mask)[:, :, : self.max_inference_len],
|
272 |
g=speaker_embedding_man[:, :, None] if self.config.gan_speaker_conditioning else None
|
273 |
)
|
274 |
+
end = time.time()
|
275 |
+
print(end - start)
|
276 |
return o
|
277 |
|
278 |
def forward(self, x, x_lengths, y, y_lengths, aux_input, inference=False):
|