We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 58e9b82 commit cdfe9a6Copy full SHA for cdfe9a6
src/whisper.cpp
@@ -1920,7 +1920,7 @@ static struct ggml_cgraph * whisper_build_graph_conv(
1920
ggml_set_input(mel_inp);
1921
1922
ggml_tensor * mel;
1923
- {
+ if (ggml_nelements(mel_inp) > 0) {
1924
const int n_len = int(mel_inp->ne[0]);
1925
const int out_s = 2 * n_ctx;
1926
const int i0 = std::min(mel_offset, n_len);
@@ -1937,6 +1937,9 @@ static struct ggml_cgraph * whisper_build_graph_conv(
1937
} else {
1938
mel = ggml_cont(ctx0, cur);
1939
}
1940
+ } else {
1941
+ // empty mel - just create a dummy tensor with the correct size
1942
+ mel = ggml_new_tensor_2d(ctx0, GGML_TYPE_F32, 2*n_ctx, n_mels);
1943
1944
1945
ggml_set_name(mel, "mel");
0 commit comments