Skip to content
Discussion options

You must be logged in to vote

You can pass those arguments like this:

import whisper
from whisper.utils import get_writer

audio_path = "audio.mp3"
model_dir = "path/to/dir"
output_dir = "path/to/dir"

torch.set_num_threads(2)
model = whisper.load_module("large", download_root=model_dir)
result = model.transcribe(audio_path, word_timestamps=True)
srt_writer = get_writer("srt", output_dir)
vtt_writer = get_writer("vtt", output_dir)
srt_writer(result, audio_path)
vtt_writer(result, audio_path)

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
9 replies
@ryanheise
Comment options

@hanserasmus
Comment options

@hanserasmus
Comment options

@ryanheise
Comment options

@hanserasmus
Comment options

Answer selected by hanserasmus
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants