Adding support for setting number of threads to faster-whisper cpu, reading from cli, yaml or env var.
This commit is contained in:
@@ -36,7 +36,7 @@ from inspect import signature
|
||||
from abc import abstractmethod
|
||||
import warnings
|
||||
|
||||
from .misc import WHISPER_DEFAULT_PATH, SCRAIBE_TORCH_DEVICE
|
||||
from .misc import WHISPER_DEFAULT_PATH, SCRAIBE_TORCH_DEVICE, SCRAIBE_NUM_THREADS
|
||||
whisper = TypeVar('whisper')
|
||||
|
||||
|
||||
@@ -348,7 +348,8 @@ class FasterWhisperTranscriber(Transcriber):
|
||||
f'device {device}! Changing compute type to int8.')
|
||||
compute_type = 'int8'
|
||||
_model = FasterWhisperModel(model, download_root=download_root,
|
||||
device=device, compute_type=compute_type)
|
||||
device=device, compute_type=compute_type,
|
||||
cpu_threads=SCRAIBE_NUM_THREADS)
|
||||
|
||||
return cls(_model, model_name=model)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user