From 1b212c6e95433c6317dda9d59f45bf52a287aee3 Mon Sep 17 00:00:00 2001 From: adamnsandle Date: Fri, 28 Oct 2022 10:26:07 +0000 Subject: [PATCH] change exception to warning --- hubconf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hubconf.py b/hubconf.py index 145be41..7fd0574 100644 --- a/hubconf.py +++ b/hubconf.py @@ -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: