mirror of
https://github.com/m-bain/whisperX.git
synced 2025-07-01 18:17:27 -04:00
mkdir for torch cache in case it doesnt exist
This commit is contained in:
@ -18,6 +18,7 @@ VAD_SEGMENTATION_URL = "https://whisperx.s3.eu-west-2.amazonaws.com/model_weight
|
|||||||
|
|
||||||
def load_vad_model(device, vad_onset, vad_offset, use_auth_token=None):
|
def load_vad_model(device, vad_onset, vad_offset, use_auth_token=None):
|
||||||
model_dir = torch.hub._get_torch_home()
|
model_dir = torch.hub._get_torch_home()
|
||||||
|
os.makedirs(model_dir, exist_ok = True)
|
||||||
model_fp = os.path.join(model_dir, "whisperx-vad-segmentation.bin")
|
model_fp = os.path.join(model_dir, "whisperx-vad-segmentation.bin")
|
||||||
if os.path.exists(model_fp) and not os.path.isfile(model_fp):
|
if os.path.exists(model_fp) and not os.path.isfile(model_fp):
|
||||||
raise RuntimeError(f"{model_fp} exists and is not a regular file")
|
raise RuntimeError(f"{model_fp} exists and is not a regular file")
|
||||||
|
Reference in New Issue
Block a user