generated from nhcarrigan/template
feat: use whisperx to allow diarization
This commit is contained in:
@@ -26,15 +26,19 @@ def record_audio():
|
||||
def transcribe_audio():
|
||||
print("🔠 Transcribing with WhisperX...")
|
||||
subprocess.run([
|
||||
# "pipenv run python3 -m whisperx",
|
||||
"whisper",
|
||||
"uvx",
|
||||
"whisperx",
|
||||
MEETING_FILE,
|
||||
"--device", "cpu", # Use CPU
|
||||
"--language", "en",
|
||||
# "--diarize", Put back when whisperX works.
|
||||
# Uncomment the next line to enable diarization, requires you to download the model from Hugging Face.
|
||||
# "--diarize",
|
||||
"--compute_type", "float32",
|
||||
"--model", WHISPER_MODEL,
|
||||
"--output_format", "json",
|
||||
"--output_dir", "."
|
||||
# You should only need to uncomment this once to perform the initial model download.
|
||||
# "--hf_token", "your_huggingface_token_here"
|
||||
], check=True)
|
||||
|
||||
def summarize_with_local_model():
|
||||
@@ -43,7 +47,7 @@ def summarize_with_local_model():
|
||||
transcript = json.load(f)
|
||||
|
||||
text = "\n".join(
|
||||
seg["text"]
|
||||
f"{seg['speaker']}: {seg['text']}"
|
||||
for seg in transcript["segments"]
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user