Spaces:
Running
Running
whisper : increase scratch buffers after recent change (#671)
Browse filesShould fix the error:
ggml_new_tensor_impl: not enough space in the scratch memory
- whisper.cpp +14 -14
whisper.cpp
CHANGED
|
@@ -218,14 +218,14 @@ static const std::map<std::string, std::pair<int, std::string>> g_lang = {
|
|
| 218 |
{ "su", { 98, "sundanese", } },
|
| 219 |
};
|
| 220 |
|
| 221 |
-
static const size_t MB = 1024*1024;
|
| 222 |
|
| 223 |
static const std::map<e_model, size_t> MEM_REQ_SCRATCH0 = {
|
| 224 |
-
{ MODEL_TINY,
|
| 225 |
-
{ MODEL_BASE,
|
| 226 |
-
{ MODEL_SMALL,
|
| 227 |
-
{ MODEL_MEDIUM,
|
| 228 |
-
{ MODEL_LARGE,
|
| 229 |
};
|
| 230 |
|
| 231 |
static const std::map<e_model, size_t> MEM_REQ_SCRATCH1 = {
|
|
@@ -1743,10 +1743,10 @@ static bool whisper_encode_internal(
|
|
| 1743 |
|
| 1744 |
//printf("%s: used_mem = %f MB, %f MB, %f MB %f MB %f MB\n", __func__,
|
| 1745 |
// ggml_used_mem(ctx0)/1024.0/1024.0,
|
| 1746 |
-
//
|
| 1747 |
-
//
|
| 1748 |
-
//
|
| 1749 |
-
//
|
| 1750 |
|
| 1751 |
ggml_free(ctx0);
|
| 1752 |
|
|
@@ -2153,10 +2153,10 @@ static bool whisper_decode_internal(
|
|
| 2153 |
if (N > 1) {
|
| 2154 |
//printf("%s: used_mem = %f MB, %f MB, %f MB %f MB %f MB\n", __func__,
|
| 2155 |
// ggml_used_mem(ctx0)/1024.0/1024.0,
|
| 2156 |
-
//
|
| 2157 |
-
//
|
| 2158 |
-
//
|
| 2159 |
-
//
|
| 2160 |
}
|
| 2161 |
|
| 2162 |
ggml_free(ctx0);
|
|
|
|
| 218 |
{ "su", { 98, "sundanese", } },
|
| 219 |
};
|
| 220 |
|
| 221 |
+
static const size_t MB = 1ull*1024*1024;
|
| 222 |
|
| 223 |
static const std::map<e_model, size_t> MEM_REQ_SCRATCH0 = {
|
| 224 |
+
{ MODEL_TINY, 14ull*MB },
|
| 225 |
+
{ MODEL_BASE, 18ull*MB },
|
| 226 |
+
{ MODEL_SMALL, 28ull*MB },
|
| 227 |
+
{ MODEL_MEDIUM, 36ull*MB },
|
| 228 |
+
{ MODEL_LARGE, 42ull*MB },
|
| 229 |
};
|
| 230 |
|
| 231 |
static const std::map<e_model, size_t> MEM_REQ_SCRATCH1 = {
|
|
|
|
| 1743 |
|
| 1744 |
//printf("%s: used_mem = %f MB, %f MB, %f MB %f MB %f MB\n", __func__,
|
| 1745 |
// ggml_used_mem(ctx0)/1024.0/1024.0,
|
| 1746 |
+
// wstate.get_buf_max_mem(0)/1024.0/1024.0,
|
| 1747 |
+
// wstate.get_buf_max_mem(1)/1024.0/1024.0,
|
| 1748 |
+
// wstate.get_buf_max_mem(2)/1024.0/1024.0,
|
| 1749 |
+
// wstate.get_buf_max_mem(3)/1024.0/1024.0);
|
| 1750 |
|
| 1751 |
ggml_free(ctx0);
|
| 1752 |
|
|
|
|
| 2153 |
if (N > 1) {
|
| 2154 |
//printf("%s: used_mem = %f MB, %f MB, %f MB %f MB %f MB\n", __func__,
|
| 2155 |
// ggml_used_mem(ctx0)/1024.0/1024.0,
|
| 2156 |
+
// wstate.get_buf_max_mem(0)/1024.0/1024.0,
|
| 2157 |
+
// wstate.get_buf_max_mem(1)/1024.0/1024.0,
|
| 2158 |
+
// wstate.get_buf_max_mem(2)/1024.0/1024.0,
|
| 2159 |
+
// wstate.get_buf_max_mem(3)/1024.0/1024.0);
|
| 2160 |
}
|
| 2161 |
|
| 2162 |
ggml_free(ctx0);
|