Skip to content

Commit

Permalink
Faster Android inference (#4)
Browse files Browse the repository at this point in the history
* Fix

* Update readme
  • Loading branch information
Macoron committed Apr 8, 2023
1 parent 030826f commit c11254d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Packages/com.whisper.unity/Runtime/WhisperParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ private void FreeLanguageString()
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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c11254d

Please sign in to comment.