From c11254df102a0c55db7dfc94e82a3e4b1c4ddb16 Mon Sep 17 00:00:00 2001 From: Alex Evgrashin Date: Sat, 8 Apr 2023 13:15:50 +0300 Subject: [PATCH] Faster Android inference (#4) * Fix * Update readme --- Packages/com.whisper.unity/Runtime/WhisperParams.cs | 6 ++++++ README.md | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Packages/com.whisper.unity/Runtime/WhisperParams.cs b/Packages/com.whisper.unity/Runtime/WhisperParams.cs index 6e00f5a..b74a602 100644 --- a/Packages/com.whisper.unity/Runtime/WhisperParams.cs +++ b/Packages/com.whisper.unity/Runtime/WhisperParams.cs @@ -243,6 +243,12 @@ public static WhisperParams GetDefaultParams(WhisperSamplingStrategy strategy = PrintRealtime = false, PrintTimestamps = false }; + + // for some reason on android one thread works + // 10x faster than multithreading +#if UNITY_ANDROID && !UNITY_EDITOR + param.ThreadsCount = 1; +#endif return param; } } diff --git a/README.md b/README.md index 6145ce9..07497bf 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This is Unity3d bindings for the [whisper.cpp](https://github.com/ggerganov/whis - Windows (x86_64) - MacOS (Intel and ARM) - iOS (Device and Simulator) -- Android (ARM64, unstable, [see this issue](https://github.com/Macoron/whisper.unity/issues/2)) +- Android (ARM64) ## Getting started Clone this repository and open it as regular Unity project. It comes with examples and tiny multilanguage model weights.