Download whisper.cpp/bindings/ruby/lib/whisper/context.rb from Dyen/Rovin: direct link, hf CLI and curl.
- Browser
- Download file 368 Bytes
-
https://huggingface.co/spaces/Dyen/Rovin/resolve/main/whisper.cpp/bindings/ruby/lib/whisper/context.rb
- Command line
-
hf download hf://spaces/Dyen/Rovin/whisper.cpp/bindings/ruby/lib/whisper/context.rb
-
curl -L -o context.rb https://huggingface.co/spaces/Dyen/Rovin/resolve/main/whisper.cpp/bindings/ruby/lib/whisper/context.rb
368 Bytes
| module Whisper | |
| class Context | |
| def to_srt | |
| each_segment.with_index.reduce("") {|srt, (segment, index)| | |
| srt << "#{index + 1}\n#{segment.to_srt_cue}\n" | |
| } | |
| end | |
| def to_webvtt | |
| each_segment.with_index.reduce("WEBVTT\n\n") {|webvtt, (segment, index)| | |
| webvtt << "#{index + 1}\n#{segment.to_webvtt_cue}\n" | |
| } | |
| end | |
| end | |
| end | |