mirror of
https://github.com/snakers4/silero-vad.git
synced 2026-02-05 18:09:22 +08:00
Fx
This commit is contained in:
6
utils.py
6
utils.py
@@ -30,6 +30,12 @@ def read_audio(path: str,
|
|||||||
return wav.squeeze(0)
|
return wav.squeeze(0)
|
||||||
|
|
||||||
|
|
||||||
|
def save_audio(path: str,
|
||||||
|
tensor: torch.Tensor,
|
||||||
|
sr: int):
|
||||||
|
torchaudio.save(path, tensor, sr)
|
||||||
|
|
||||||
|
|
||||||
def init_jit_model(model_path: str,
|
def init_jit_model(model_path: str,
|
||||||
device=torch.device('cpu')):
|
device=torch.device('cpu')):
|
||||||
torch.set_grad_enabled(False)
|
torch.set_grad_enabled(False)
|
||||||
|
|||||||
Reference in New Issue
Block a user