Skip to content

Commit 6b6da35

Browse files
authored
Merge branch 'ggml-org:master' into master
2 parents f30d303 + 30c5194 commit 6b6da35

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bindings/ruby/ext/ruby_whisper_context.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,11 @@ VALUE ruby_whisper_model_type(VALUE self)
304304
static bool
305305
check_memory_view(rb_memory_view_t *memview)
306306
{
307-
if (strcmp(memview->format, "f") != 0) {
307+
if (memview->format != NULL && strcmp(memview->format, "f") != 0) {
308308
rb_warn("currently only format \"f\" is supported for MemoryView, but given: %s", memview->format);
309309
return false;
310310
}
311-
if (memview->ndim != 1) {
311+
if (memview->format != NULL && memview->ndim != 1) {
312312
rb_warn("currently only 1 dimensional MemoryView is supported, but given: %zd", memview->ndim);
313313
return false;
314314
}
@@ -377,7 +377,7 @@ parse_samples(VALUE *samples, VALUE *n_samples)
377377
}
378378
parsed.n_samples = (int)n_samples_size;
379379
} else {
380-
rb_warn("unable to get a memory view. fallbacks to Ruby object");
380+
rb_warn("unable to get a memory view. falls back to Ruby object");
381381
if (rb_respond_to(*samples, id_length)) {
382382
parsed.n_samples = NUM2INT(rb_funcall(*samples, id_length, 0));
383383
} else {

0 commit comments

Comments
 (0)