Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to try samples #97

Closed
KurashinaYoshiteru opened this issue Aug 10, 2024 · 2 comments · Fixed by #98
Closed

How to try samples #97

KurashinaYoshiteru opened this issue Aug 10, 2024 · 2 comments · Fixed by #98
Labels
bug Something isn't working

Comments

@KurashinaYoshiteru
Copy link

Overview

I cloned the repository and tried to test the sample in my local environment.
However, I get the following error and it does not work.

  • Failed to load Whisper model!
  • NullReferenceException: Object reference not set to an instance of an object
  • Init Whisper model first!

What I want to do

I want to run the sample in my local environment.
Could you tell me how to set it up initially?

What I tried and what I did

  1. Cloned the project and opened it in the editor.
  2. opened the "1 - Audio Clip" scene and ran it in the editor.
  3. Error occurred.
  4. Checked "Enable CUDA" in ProjectSettings.
  5. Checked "Init On Awake" in Whisper object Inspector.
  6. Inserted the file "ggml-small.bin" in the SteamingAssets/Whisper folder and changed "ModelPath" to "Whisper/ggml-small.bin" in the Inspector of the Whisper object.

Error

  • Failed to load Whisper model!

UnityEngine.Debug:LogError (object)
Whisper.Utils.LogUtils:Error (string) (at ./Packages/com.whisper.unity/Runtime/Utils/LogUtils.cs:28)
Whisper.WhisperWrapper:InitFromFile (string,Whisper.WhisperContextParams) (at ./Packages/com.whisper.unity/Runtime/WhisperWrapper.cs:301)
Whisper.WhisperWrapper/<>c__DisplayClass27_0:b__0 () (at ./Packages/com.whisper.unity/Runtime/WhisperWrapper.cs:334)
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()

  • NullReferenceException: Object reference not set to an instance of an object

Whisper.WhisperManager.InitModel () (at ./Packages/com.whisper.unity/Runtime/WhisperManager.cs:188)
UnityEngine.Debug:LogException(Exception)
Whisper.Utils.LogUtils:Exception(Exception) (at ./Packages/com.whisper.unity/Runtime/Utils/LogUtils.cs:23)
Whisper.d__44:MoveNext() (at ./Packages/com.whisper.unity/Runtime/WhisperManager.cs:193)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetResult(WhisperWrapper) Whisper.<InitFromFileAsync>d__26:MoveNext() (at ./Packages/com.whisper.unity/Runtime/WhisperWrapper.cs:319) System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetResult(WhisperWrapper)
Whisper.d__27:MoveNext() (at ./Packages/com.whisper.unity/Runtime/WhisperWrapper.cs:337)
UnityEngine.UnitySynchronizationContext:ExecuteTasks()

  • Whisper model isn't loaded! Init Whisper model first!

UnityEngine.Debug:LogError (object)
Whisper.Utils.LogUtils:Error (string) (at ./Packages/com.whisper.unity/Runtime/Utils/LogUtils.cs:28)
Whisper.WhisperManager/d__51:MoveNext () (at ./Packages/com.whisper.unity/Runtime/WhisperManager.cs:308)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder1<bool>:Start<Whisper.WhisperManager/<CheckIfLoaded>d__51> (Whisper.WhisperManager/<CheckIfLoaded>d__51&) Whisper.WhisperManager:CheckIfLoaded () Whisper.WhisperManager/<GetTextAsync>d__46:MoveNext () (at ./Packages/com.whisper.unity/Runtime/WhisperManager.cs:219) System.Runtime.CompilerServices.AsyncTaskMethodBuilder1<Whisper.WhisperResult>:Start<Whisper.WhisperManager/d__46> (Whisper.WhisperManager/d__46&)
Whisper.WhisperManager:GetTextAsync (UnityEngine.AudioClip)
Whisper.Samples.AudioClipDemo/d__13:MoveNext () (at Assets/Samples/1 - Audio Clip/AudioClipDemo.cs:52)
System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start<Whisper.Samples.AudioClipDemo/d__13> (Whisper.Samples.AudioClipDemo/d__13&)
Whisper.Samples.AudioClipDemo:ButtonPressed ()
UnityEngine.EventSystems.EventSystem:Update () (at ./Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:530)

Environment

  • Windows 10
  • Unity 20223.23.f1
  • CUDA 12.6.0

ErrorMessage

@Macoron
Copy link
Owner

Macoron commented Aug 11, 2024

This error indicates that underlying library whisper.cpp failed to load model weights. Hard to say for sure why. Could you send your PC specs? Maybe you have old CPU that doesn't support AVX?

Also, do you have any non-English letters in path to your model/unity project?

@Macoron Macoron added the bug Something isn't working label Aug 11, 2024
@KurashinaYoshiteru
Copy link
Author

The CPU of my PC is an "AMD Ryzen 5 3500 6-Core".
But that was not the problem, it was the fact that the file path contained a language other than English.
I solved the problem successfully and the sample worked without any problems!
It was very helpful. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants