Skip to content

Commit

Permalink
Merge pull request #183 from jhj0517/feature/integrate-whisperx
Browse files Browse the repository at this point in the history
Fix strip bug
  • Loading branch information
jhj0517 authored Jun 27, 2024
2 parents 8449dc3 + be3301d commit fbdb0fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/diarize/diarizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from modules.diarize.diarize_pipeline import DiarizationPipeline, assign_word_speakers
from modules.diarize.audio_loader import load_audio


class Diarizer:
def __init__(self,
model_dir: str = os.path.join("models", "Diarization")
Expand Down Expand Up @@ -67,7 +68,7 @@ def run(self,
speaker = "None"
if "speaker" in segment:
speaker = segment["speaker"]
segment["text"] = speaker + "|" + segment["text"][1:]
segment["text"] = speaker + "|" + segment["text"].strip()

elapsed_time = time.time() - start_time
return diarized_result["segments"], elapsed_time
Expand Down

0 comments on commit fbdb0fb

Please sign in to comment.