ruby : transcribe without GVL, accept more MemoryViews, Windows support, fix memory size report, improve document (#3775)

* Change MemoryView example using NDAV

* Add note on audio attributes for #full and #full_parallel

* Support more variants of MemoryView

* Use IO.popen instead of Kernel.` for Windows compatibility

* Use cmake's -C option instead of multiple -D options

* Fix memsize calculation

* Remove unused argument

* Add is_interrupted field to abort callback container

* Fix RBS syntax

* Address document comment for RDoc

* Add .document for RDoc

* Add .rdoc_options

* Run #full without GVL

* Initialize callbacks with nil

* Specify implicity Whisper::Params to distinguish from Whisper::Context::Params

* Run callbacks without GVL

* Call log callback with GVL

* Run full_parallel without GVL

* Run transcribe without GVL

* Fix ruby_whisper_lock_gvl and ruby_whisper_unlock_gvl

* Fix return value of encoder_begin_callback

* Report GVL unlocking from transcribe

* Remove unused interface

* Restore overload of full_parallel

* Close process

* Fix struct name

* Make is_without_gvl thread local

* Use rb_thread_call_with_gvl instead of global variable

* Retrieve instance variable in GVL

* Narrow acceptable MemoryView format

* Fix option cache path

* Reduce files in package

* Use append_cflags

* Add ext/*.rb to task dependencies

* Use copy instead of cp

* Make TestPackage more portable

* Patch for lower version Ruby

* Make build scripts more portable

* Add Windows support

* Don't raise exceptions
This commit is contained in:
KITAITI Makoto
2026-05-07 06:28:18 +02:00
committed by GitHub
parent 4bf733672b
commit c81b2dabbc
17 changed files with 653 additions and 166 deletions
+26 -10
View File
@@ -5,37 +5,53 @@ ignored_dirs = %w[
.devops
.github
ci
examples/wchess/wchess.wasm
examples/addon.node
examples/bench.wasm
examples/command
examples/command.wasm
examples/lsp
examples/main
examples/python
examples/stream
examples/stream.wasm
examples/sycl
examples/talk-llama
examples/wchess
examples/whisper.android
examples/whisper.android.java
examples/whisper.nvim
examples/whisper.objc
examples/whisper.swiftui
examples/whisper.wasm
grammars
models
samples
scripts
tests
].collect {|dir| root/dir}
ignored_files = %w[
AUTHORS
Makefile
README.md
README_sycl.md
.gitignore
.gitmodules
.dockerignore
whisper.nvim
twitch.sh
yt-wsp.sh
close-issue.yml
build-xcframework.sh
]
ignored_exts = %w[
.yml
.sh
.md
.py
.js
.nvim
]
EXTSOURCES =
`git ls-files -z #{root}`.split("\x0")
.collect {|file| Pathname(file)}
.reject {|file|
ignored_dirs.any? {|dir| file.descend.any? {|desc| desc == dir}} ||
ignored_exts.include?(file.extname) ||
ignored_files.include?(file.basename.to_path) ||
(file.descend.to_a[1] != root && file.descend.to_a[1] != Pathname("..")/"javascript")
ignored_dirs.any? {|dir| file.descend.any? {|desc| desc == dir}} ||
(file.descend.to_a[1] != root && file != Pathname("..")/"javascript"/"package-tmpl.json")
}
.collect(&:to_path)