Skip to content

Commit

Permalink
Fixup. Format code with Black
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Aug 23, 2024
1 parent 8ec2846 commit 3294742
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pod/video_encode_transcript/transcript_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,15 +419,13 @@ def main_whisper_transcript(norm_mp3_file, duration, lang):
],
)
audio = convert_samplerate(norm_mp3_file, desired_sample_rate, 0, duration)
transcription = model.transcribe(audio, language=lang, initial_prompt="prompt", word_timestamps=True)
transcription = model.transcribe(
audio, language=lang, initial_prompt="prompt", word_timestamps=True
)
dirname = os.path.dirname(norm_mp3_file)
filename = os.path.basename(norm_mp3_file).replace(".mp3", ".vtt")
vtt_writer = get_writer("vtt", dirname)
word_options = {
"highlight_words": False,
"max_line_count": 2,
"max_line_width": 40
}
word_options = {"highlight_words": False, "max_line_count": 2, "max_line_width": 40}
vtt_writer(transcription, filename, word_options)
wvtt = webvtt.read(os.path.join(dirname, filename))
inference_end = timer() - inference_start
Expand Down

0 comments on commit 3294742

Please sign in to comment.