Skip to content

Commit

Permalink
update to use new whisper Writer API
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarx authored Jan 28, 2023
1 parent 6595421 commit c22c3ee
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Video_Killed_The_Radio_Star_Defusion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -506,14 +506,15 @@
" transcriptions = {}\n",
" transcription_root = root / 'whispers'\n",
" transcription_root.mkdir(parents=True, exist_ok=True)\n",
" writer = whisper.utils.get_writer(output_format='vtt', output_dir=transcription_root) # output dir doesn't do anything...?\n",
" for k in whispers:\n",
" outpath = str( transcription_root / f\"{k}.vtt\" )\n",
" transcriptions[k] = outpath\n",
" with open(outpath,'w') as f:\n",
" # to do: upstream PR to control verbosity\n",
" whisper.utils.write_vtt(\n",
" whispers[k][\"segments\"], # ...really?\n",
" file=f\n",
" writer.write_result(\n",
" whispers[k],\n",
" file=f,\n",
" )\n",
" storyboard.params.whisper.transcriptions = transcriptions\n",
"\n",
Expand Down Expand Up @@ -1354,4 +1355,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}

0 comments on commit c22c3ee

Please sign in to comment.