-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Whisper integration for speaker generation
Added Whisper-based transcription for speaker creation when `transcript` is None (#28).
- Loading branch information
Showing
4 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import whisper | ||
from loguru import logger | ||
|
||
def transcribe_once(audio_path: str, model: str = "turbo", device = None): | ||
logger.info(f"Loading model {model}") | ||
model = whisper.load_model("turbo", device=device) | ||
logger.info(f"Transcribing {audio_path}") | ||
text = model.transcribe(audio_path)["text"] | ||
logger.success(f"Transcription: {text}") | ||
return text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,5 @@ requests | |
sounddevice | ||
mecab-python3 | ||
unidic-lite | ||
uroman | ||
uroman | ||
openai-whisper>=20240930 |