Skip to content

Commit

Permalink
ref ggerganov#62 : fix build for some compilers
Browse files Browse the repository at this point in the history
For some reason, new version of GCC panic when the struct type is not
specified explicitly
  • Loading branch information
ggerganov committed Oct 18, 2022
1 parent b4a3875 commit d6b84b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ stream
.cache
build/
build-em/
build-debug/
build-release/
out/
.vs/
.vscode/
Expand Down
10 changes: 9 additions & 1 deletion whisper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2262,7 +2262,11 @@ struct whisper_full_params whisper_full_default_params(enum whisper_decode_strat
switch (strategy) {
case WHISPER_DECODE_GREEDY:
{
#if defined(_MSC_VER)
result = {
#else
result = (struct whisper_full_params) {
#endif
.strategy = WHISPER_DECODE_GREEDY,
.n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()),
.offset_ms = 0,
Expand All @@ -2283,8 +2287,12 @@ struct whisper_full_params whisper_full_default_params(enum whisper_decode_strat
} break;
case WHISPER_DECODE_BEAM_SEARCH:
{
#if defined(_MSC_VER)
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()),
.offset_ms = 0,

Expand Down

0 comments on commit d6b84b2

Please sign in to comment.