ruby : bug fix on callbacks and no_speech_prob (#2656)

* Don't generate documentation on test

* Move .startup to TestBase class

* Extract new_segment_callback as a function

* Extract progress_callback as a function

* Extract abort_callback as a function

* Extract register_callbacks as a function

* Call callbacks in Whiser::Context#full and #full_parallel

* Fix README

* Care about the cases content-size is nil and TTY is not available

* Add tests for no_speech_prob

* Add Whisper::Context#full_get_segment_no_speech_prob and Whisper::Segment#no_speech_prob
This commit is contained in:
KITAITI Makoto
2024-12-21 21:52:06 +02:00
committed by GitHub
parent 4183517076
commit f07a81aa9f
7 changed files with 166 additions and 123 deletions
+2 -2
View File
@@ -63,7 +63,7 @@ whisper = Whisper::Context.new("base.en")
You can see the list of prepared model names by `Whisper::Model.preconverted_models.keys`:
```ruby
puts Whisper::Model.preconverted_model_names
puts Whisper::Model.preconverted_models.keys
# tiny
# tiny.en
# tiny-q5_1
@@ -220,7 +220,7 @@ whisper.each_segment do |segment|
end
```
The second argument `samples` may be an array, an object with `length` method, or a MemoryView. If you can prepare audio data as C array and export it as a MemoryView, whispercpp accepts and works with it with zero copy.
The second argument `samples` may be an array, an object with `length` and `each` method, or a MemoryView. If you can prepare audio data as C array and export it as a MemoryView, whispercpp accepts and works with it with zero copy.
License
-------