change exception to warning

This commit is contained in:
adamnsandle
2022-10-28 10:26:07 +00:00
parent 452060ad65
commit 1b212c6e95

View File

@@ -1,6 +1,7 @@
dependencies = ['torch', 'torchaudio']
import torch
import json
import warnings
from utils_vad import (init_jit_model,
get_speech_timestamps,
get_number_ts,
@@ -28,8 +29,8 @@ def silero_vad(onnx=False, force_onnx_cpu=False):
if not onnx:
installed_version = torch.__version__
supported_version = '1.12.0'
if versiontuple(installed_version) < versiontuple(supported_version):
raise Exception(f'Please install torch {supported_version} or greater ({installed_version} installed)')
if not versiontuple(installed_version) >= versiontuple(supported_version):
warnings.warn(f'Please install torch {supported_version} or greater ({installed_version} installed)')
hub_dir = torch.hub.get_dir()
if onnx: