Make Faster Whisper and OpenAI Whisper work
This commit is contained in:
@@ -37,7 +37,6 @@ class Configuration:
|
||||
|
||||
class WhisperModel(Model):
|
||||
def __init__(self):
|
||||
# TODO
|
||||
self._result: str = ''
|
||||
self._config = OpenAIWhisperSettings()
|
||||
|
||||
@@ -45,7 +44,7 @@ class WhisperModel(Model):
|
||||
def result(self) -> str:
|
||||
return self._result
|
||||
|
||||
def transcribe(self, result: Results, audio_file: Path) -> str:
|
||||
def transcribe(self, result: Results, audio_file: Path) -> None:
|
||||
model = whisper.load_model(self._config.model_size)
|
||||
log.debug('model size is used = %s', self._config.model_size)
|
||||
result.text = model.transcribe(audio_file)['text'] # pyright: ignore [reportAttributeAccessIssue]
|
||||
|
||||
Reference in New Issue
Block a user