whispercpp 1.2.0.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +4 -19
- data/ext/extconf.rb +9 -0
- data/ext/ggml.c +18380 -5241
- data/ext/ggml.h +2156 -502
- data/ext/ruby_whisper.cpp +2 -2
- data/ext/whisper.cpp +4184 -1774
- data/ext/whisper.h +348 -56
- metadata +3 -3
data/ext/ruby_whisper.cpp
CHANGED
@@ -87,7 +87,7 @@ static VALUE ruby_whisper_initialize(int argc, VALUE *argv, VALUE self) {
|
|
87
87
|
if (!rb_respond_to(whisper_model_file_path, rb_intern("to_s"))) {
|
88
88
|
rb_raise(rb_eRuntimeError, "Expected file path to model to initialize Whisper::Context");
|
89
89
|
}
|
90
|
-
rw->context =
|
90
|
+
rw->context = whisper_init_from_file_with_params(StringValueCStr(whisper_model_file_path), whisper_context_default_params());
|
91
91
|
if (rw->context == nullptr) {
|
92
92
|
rb_raise(rb_eRuntimeError, "error: failed to initialize whisper context");
|
93
93
|
}
|
@@ -199,7 +199,7 @@ static VALUE ruby_whisper_transcribe(int argc, VALUE *argv, VALUE self) {
|
|
199
199
|
{
|
200
200
|
static bool is_aborted = false; // NOTE: this should be atomic to avoid data race
|
201
201
|
|
202
|
-
rwp->params.encoder_begin_callback = [](struct whisper_context * /*ctx*/, void * user_data) {
|
202
|
+
rwp->params.encoder_begin_callback = [](struct whisper_context * /*ctx*/, struct whisper_state * /*state*/, void * user_data) {
|
203
203
|
bool is_aborted = *(bool*)user_data;
|
204
204
|
return !is_aborted;
|
205
205
|
};
|