feat: use whisperx to allow diarization

This commit is contained in:
2025-08-05 13:35:00 -07:00
parent 53f30437d9
commit 97e325c0b7
2 changed files with 24 additions and 4 deletions
+8 -4
View File
@@ -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"]
)