mirror of
https://github.com/2noise/ChatTTS.git
synced 2026-08-30 17:05:27 +08:00
fix: stream mode, last chunk of audio file size (#564)
* fix stream mode, last chunk of audio file size * Update core.py * Update core.py * Update core.py
This commit is contained in:
+6
-1
@@ -415,7 +415,12 @@ class Chat:
|
||||
else:
|
||||
yield wavs
|
||||
if stream:
|
||||
yield wavs[:, length:]
|
||||
new_wavs = wavs[:, length:]
|
||||
# Identify rows with non-zero elements using np.any
|
||||
# keep_rows = np.any(array != 0, axis=1)
|
||||
keep_cols = np.sum(new_wavs != 0, axis=0) > 0
|
||||
# Filter both rows and columns using slicing
|
||||
yield new_wavs[:][:, keep_cols]
|
||||
|
||||
@torch.inference_mode()
|
||||
def _vocos_decode(self, spec: torch.Tensor) -> np.ndarray:
|
||||
|
||||
Reference in New Issue
Block a user