You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Making this discussion since I spent a pretty long time looking for this and couldnt find anything in discussions
If you want to limit how many words are generated on an srt file you need to call the SRT Writer function with the kwarg of max_words_per_line= x
import whisper
from whisper.utils import get_writer
device = "cuda" if torch.cuda.is_available() else "cpu"
model = whisper.load_model(model_name).to(device)
language = "en" if model_name.endswith(".en") else None
subtitles = model.transcribe(self.audioPath, language=language, temperature=0.0, word_timestamps=True)
writer = get_writer("srt", output_dir=self.output_path)
writer(subtitles, filename, max_words_per_line=1 )
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Making this discussion since I spent a pretty long time looking for this and couldnt find anything in discussions
If you want to limit how many words are generated on an srt file you need to call the SRT Writer function with the kwarg of max_words_per_line= x
Beta Was this translation helpful? Give feedback.
All reactions