Skip to content

Commit

Permalink
Whisper Multi-threading for Android
Browse files Browse the repository at this point in the history
  • Loading branch information
HanzaRu committed Apr 2, 2024
1 parent af0eb68 commit 21bb2f9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,4 @@ tmp/
mono_crash.*.json
*.blob
CodeCoverage/
.vsconfig
7 changes: 7 additions & 0 deletions Packages/com.whisper.unity/README.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions Packages/com.whisper.unity/Runtime/WhisperParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,13 @@ public static WhisperParams GetDefaultParams(WhisperSamplingStrategy strategy =
PrintTimestamps = false
};

// for some reason on android one thread works
// 10x faster than multithreading
// for some reason on android one thread works
// 10x faster than multithreading
#if UNITY_ANDROID && !UNITY_EDITOR
param.ThreadsCount = 1;
var threads = SystemInfo.processorCount - 1;
param.ThreadsCount = threads > 0? threads : 1;
#endif
return param;
return param;
}
}
}

0 comments on commit 21bb2f9

Please sign in to comment.