Skip to content

Commit af745e4

Browse files
committed
release : v1.4.1
1 parent 30edc4c commit af745e4

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ publish: publish-trigger
3030
\n\
3131
cd /path/to/whisper.cpp/bindings/ios\n\
3232
git commit\n\
33-
git tag 1.4.0\n\
33+
git tag 1.4.1\n\
3434
git push origin master --tags\n\
3535
"
3636

Sources/whisper/ggml.c

+12-12
Original file line numberDiff line numberDiff line change
@@ -1911,8 +1911,8 @@ static void dequantize_row_q5_0(const void * restrict vx, float * restrict y, in
19111911
const uint8_t vi = pp[l/2];
19121912

19131913
// extract the 5-th bit from qh
1914-
const uint8_t vh0 = ((qh & (1 << (l + 0))) >> (l + 0)) << 4;
1915-
const uint8_t vh1 = ((qh & (1 << (l + 1))) >> (l + 1)) << 4;
1914+
const uint8_t vh0 = ((qh & (1u << (l + 0))) >> (l + 0)) << 4;
1915+
const uint8_t vh1 = ((qh & (1u << (l + 1))) >> (l + 1)) << 4;
19161916

19171917
const int8_t vi0 = (vi & 0x0F) | vh0;
19181918
const int8_t vi1 = (vi >> 4) | vh1;
@@ -1948,8 +1948,8 @@ static void dequantize_row_q5_1(const void * restrict vx, float * restrict y, in
19481948
const uint8_t vi = pp[l/2];
19491949

19501950
// extract the 5-th bit from qh
1951-
const uint8_t vh0 = ((qh & (1 << (l + 0))) >> (l + 0)) << 4;
1952-
const uint8_t vh1 = ((qh & (1 << (l + 1))) >> (l + 1)) << 4;
1951+
const uint8_t vh0 = ((qh & (1u << (l + 0))) >> (l + 0)) << 4;
1952+
const uint8_t vh1 = ((qh & (1u << (l + 1))) >> (l + 1)) << 4;
19531953

19541954
const uint8_t vi0 = (vi & 0x0F) | vh0;
19551955
const uint8_t vi1 = (vi >> 4) | vh1;
@@ -3286,8 +3286,8 @@ static void ggml_vec_dot_q5_0_q8_0(const int n, float * restrict s, const void *
32863286
for (int j = 0; j < QK8_0/2; j++) {
32873287
const uint8_t v0 = x0[j];
32883288

3289-
const int x0_0h = ((qh & (1 << (2*j + 0))) >> (2*j + 0)) << 4;
3290-
const int x1_0h = ((qh & (1 << (2*j + 1))) >> (2*j + 1)) << 4;
3289+
const int x0_0h = ((qh & (1u << (2*j + 0))) >> (2*j + 0)) << 4;
3290+
const int x1_0h = ((qh & (1u << (2*j + 1))) >> (2*j + 1)) << 4;
32913291

32923292
const int x0_0 = ((v0 & 0x0F) | x0_0h) - 16;
32933293
const int x1_0 = ((v0 >> 4) | x1_0h) - 16;
@@ -3491,8 +3491,8 @@ static void ggml_vec_dot_q5_1_q8_1(const int n, float * restrict s, const void *
34913491
for (int j = 0; j < QK8_1/2; j++) {
34923492
const uint8_t v0 = x0[j];
34933493

3494-
const int x0_0h = ((qh & (1 << (2*j + 0))) >> (2*j + 0)) << 4;
3495-
const int x1_0h = ((qh & (1 << (2*j + 1))) >> (2*j + 1)) << 4;
3494+
const int x0_0h = ((qh & (1u << (2*j + 0))) >> (2*j + 0)) << 4;
3495+
const int x1_0h = ((qh & (1u << (2*j + 1))) >> (2*j + 1)) << 4;
34963496

34973497
const int x0_0 = (v0 & 0x0F) | x0_0h;
34983498
const int x1_0 = (v0 >> 4) | x1_0h;
@@ -13057,8 +13057,8 @@ size_t ggml_quantize_q5_0(const float * src, void * dst, int n, int k, int64_t *
1305713057
memcpy(&qh, &y[i].qh, sizeof(qh));
1305813058

1305913059
for (int l = 0; l < QK5_0; l += 2) {
13060-
const uint8_t vh0 = ((qh & (1 << (l + 0))) >> (l + 0)) << 4;
13061-
const uint8_t vh1 = ((qh & (1 << (l + 1))) >> (l + 1)) << 4;
13060+
const uint8_t vh0 = ((qh & (1u << (l + 0))) >> (l + 0)) << 4;
13061+
const uint8_t vh1 = ((qh & (1u << (l + 1))) >> (l + 1)) << 4;
1306213062

1306313063
// cast to 16 bins
1306413064
const uint8_t vi0 = ((y[i].qs[l/2] & 0x0F) | vh0) / 2;
@@ -13087,8 +13087,8 @@ size_t ggml_quantize_q5_1(const float * src, void * dst, int n, int k, int64_t *
1308713087
memcpy(&qh, &y[i].qh, sizeof(qh));
1308813088

1308913089
for (int l = 0; l < QK5_1; l += 2) {
13090-
const uint8_t vh0 = ((qh & (1 << (l + 0))) >> (l + 0)) << 4;
13091-
const uint8_t vh1 = ((qh & (1 << (l + 1))) >> (l + 1)) << 4;
13090+
const uint8_t vh0 = ((qh & (1u << (l + 0))) >> (l + 0)) << 4;
13091+
const uint8_t vh1 = ((qh & (1u << (l + 1))) >> (l + 1)) << 4;
1309213092

1309313093
// cast to 16 bins
1309413094
const uint8_t vi0 = ((y[i].qs[l/2] & 0x0F) | vh0) / 2;

Sources/whisper/whisper.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ static bool whisper_model_load(struct whisper_model_loader * loader, whisper_con
13331333
}
13341334

13351335
int32_t nelements = 1;
1336-
int32_t ne[3] = { 1, 1, 1 };
1336+
int32_t ne[4] = { 1, 1, 1, 1 };
13371337
for (int i = 0; i < n_dims; ++i) {
13381338
read_safe(loader, ne[i]);
13391339
nelements *= ne[i];
@@ -1352,6 +1352,8 @@ static bool whisper_model_load(struct whisper_model_loader * loader, whisper_con
13521352
auto tensor = model.tensors[name.data()];
13531353
if (ggml_nelements(tensor) != nelements) {
13541354
fprintf(stderr, "%s: tensor '%s' has wrong size in model file\n", __func__, name.data());
1355+
fprintf(stderr, "%s: shape: [%d, %d, %d], expected: [%d, %d, %d]\n",
1356+
__func__, ne[0], ne[1], ne[2], (int) tensor->ne[0], (int) tensor->ne[1], (int) tensor->ne[2]);
13551357
return false;
13561358
}
13571359

0 commit comments

Comments
 (0)