Spaces:
Running
Running
ref #62 : fix build for some compilers
Browse filesFor some reason, new version of GCC panic when the struct type is not
specified explicitly
- .gitignore +2 -0
- whisper.cpp +9 -1
.gitignore
CHANGED
|
@@ -5,6 +5,8 @@ stream
|
|
| 5 |
.cache
|
| 6 |
build/
|
| 7 |
build-em/
|
|
|
|
|
|
|
| 8 |
out/
|
| 9 |
.vs/
|
| 10 |
.vscode/
|
|
|
|
| 5 |
.cache
|
| 6 |
build/
|
| 7 |
build-em/
|
| 8 |
+
build-debug/
|
| 9 |
+
build-release/
|
| 10 |
out/
|
| 11 |
.vs/
|
| 12 |
.vscode/
|
whisper.cpp
CHANGED
|
@@ -2262,7 +2262,11 @@ struct whisper_full_params whisper_full_default_params(enum whisper_decode_strat
|
|
| 2262 |
switch (strategy) {
|
| 2263 |
case WHISPER_DECODE_GREEDY:
|
| 2264 |
{
|
|
|
|
| 2265 |
result = {
|
|
|
|
|
|
|
|
|
|
| 2266 |
.strategy = WHISPER_DECODE_GREEDY,
|
| 2267 |
.n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()),
|
| 2268 |
.offset_ms = 0,
|
|
@@ -2283,8 +2287,12 @@ struct whisper_full_params whisper_full_default_params(enum whisper_decode_strat
|
|
| 2283 |
} break;
|
| 2284 |
case WHISPER_DECODE_BEAM_SEARCH:
|
| 2285 |
{
|
|
|
|
| 2286 |
result = {
|
| 2287 |
-
|
|
|
|
|
|
|
|
|
|
| 2288 |
.n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()),
|
| 2289 |
.offset_ms = 0,
|
| 2290 |
|
|
|
|
| 2262 |
switch (strategy) {
|
| 2263 |
case WHISPER_DECODE_GREEDY:
|
| 2264 |
{
|
| 2265 |
+
#if defined(_MSC_VER)
|
| 2266 |
result = {
|
| 2267 |
+
#else
|
| 2268 |
+
result = (struct whisper_full_params) {
|
| 2269 |
+
#endif
|
| 2270 |
.strategy = WHISPER_DECODE_GREEDY,
|
| 2271 |
.n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()),
|
| 2272 |
.offset_ms = 0,
|
|
|
|
| 2287 |
} break;
|
| 2288 |
case WHISPER_DECODE_BEAM_SEARCH:
|
| 2289 |
{
|
| 2290 |
+
#if defined(_MSC_VER)
|
| 2291 |
result = {
|
| 2292 |
+
#else
|
| 2293 |
+
result = (struct whisper_full_params) {
|
| 2294 |
+
#endif
|
| 2295 |
+
.strategy = WHISPER_DECODE_BEAM_SEARCH,
|
| 2296 |
.n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()),
|
| 2297 |
.offset_ms = 0,
|
| 2298 |
|