Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matching faster_whisper to openai response #180

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix words if not word_timestamps
gonzafirewall committed Apr 26, 2024
commit 42330ecbec5e0818d551b5e07e962fdf8145198c
3 changes: 2 additions & 1 deletion app/faster_whisper/core.py
Original file line number Diff line number Diff line change
@@ -60,7 +60,8 @@ def transcribe(
segment_generator, info = model.transcribe(audio, beam_size=5, **options_dict)
for segment in segment_generator:
seg_dict = segment._asdict()
seg_dict["words"] = [to_whisper_word(word) for word in seg_dict["words"]]
if "words" in seg_dict:
seg_dict["words"] = [to_whisper_word(word) for word in seg_dict["words"]]
segments.append(seg_dict)
text = text + segment.text
result = {