set local_files_only=True when downloading whisper model

This commit is contained in:
harry
2024-03-28 11:46:22 +08:00
parent d5ab841650
commit 4aa820b200

View File

@@ -18,7 +18,10 @@ def create(audio_file, subtitle_file: str = ""):
global model
if not model:
logger.info(f"loading model: {model_size}, device: {device}, compute_type: {compute_type}")
model = WhisperModel(model_size_or_path=model_size, device=device, compute_type=compute_type)
model = WhisperModel(model_size_or_path=model_size,
device=device,
compute_type=compute_type,
local_files_only=True)
logger.info(f"start, output file: {subtitle_file}")
if not subtitle_file: