mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2024-12-27 09:08:55 +01:00
ref #62 : fix build for some compilers
For some reason, new version of GCC panic when the struct type is not specified explicitly
This commit is contained in:
parent
b4a3875b2c
commit
d6b84b2a23
2
.gitignore
vendored
2
.gitignore
vendored
@ -5,6 +5,8 @@ stream
|
|||||||
.cache
|
.cache
|
||||||
build/
|
build/
|
||||||
build-em/
|
build-em/
|
||||||
|
build-debug/
|
||||||
|
build-release/
|
||||||
out/
|
out/
|
||||||
.vs/
|
.vs/
|
||||||
.vscode/
|
.vscode/
|
||||||
|
10
whisper.cpp
10
whisper.cpp
@ -2262,7 +2262,11 @@ struct whisper_full_params whisper_full_default_params(enum whisper_decode_strat
|
|||||||
switch (strategy) {
|
switch (strategy) {
|
||||||
case WHISPER_DECODE_GREEDY:
|
case WHISPER_DECODE_GREEDY:
|
||||||
{
|
{
|
||||||
|
#if defined(_MSC_VER)
|
||||||
result = {
|
result = {
|
||||||
|
#else
|
||||||
|
result = (struct whisper_full_params) {
|
||||||
|
#endif
|
||||||
.strategy = WHISPER_DECODE_GREEDY,
|
.strategy = WHISPER_DECODE_GREEDY,
|
||||||
.n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()),
|
.n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()),
|
||||||
.offset_ms = 0,
|
.offset_ms = 0,
|
||||||
@ -2283,8 +2287,12 @@ struct whisper_full_params whisper_full_default_params(enum whisper_decode_strat
|
|||||||
} break;
|
} break;
|
||||||
case WHISPER_DECODE_BEAM_SEARCH:
|
case WHISPER_DECODE_BEAM_SEARCH:
|
||||||
{
|
{
|
||||||
|
#if defined(_MSC_VER)
|
||||||
result = {
|
result = {
|
||||||
.strategy = WHISPER_DECODE_GREEDY,
|
#else
|
||||||
|
result = (struct whisper_full_params) {
|
||||||
|
#endif
|
||||||
|
.strategy = WHISPER_DECODE_BEAM_SEARCH,
|
||||||
.n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()),
|
.n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()),
|
||||||
.offset_ms = 0,
|
.offset_ms = 0,
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user