mirror of
https://github.com/snakers4/silero-vad.git
synced 2026-02-05 01:49:22 +08:00
Added dimension to tensor to save audio
Иначе во всех примерах (в колабе по крайней мере), вылетала ошибка: ValueError: Expected 2D Tensor, got 1D.
This commit is contained in:
@@ -41,7 +41,7 @@ def read_audio(path: str,
|
||||
def save_audio(path: str,
|
||||
tensor: torch.Tensor,
|
||||
sr: int = 16000):
|
||||
torchaudio.save(path, tensor, sr)
|
||||
torchaudio.save(path, tensor.unsqueeze(0), sr)
|
||||
|
||||
|
||||
def init_jit_model(model_path: str,
|
||||
|
||||
Reference in New Issue
Block a user