piper.unity icon indicating copy to clipboard operation
piper.unity copied to clipboard

Sentis update

Open m0nsky opened this issue 2 years ago • 2 comments

I tried updating this project to a more recent version of Sentis (since the pre-release used is getting a bit old and hard to find), but noticed the main thread would stall on inference. Any chance you could update it to work with one of the latest official releases? (for example 2.0 or 2.1)

m0nsky avatar Oct 06 '24 08:10 m0nsky

I've implemented a version that works with the latest Sentis releases (2.0/2.1) and published it here: https://github.com/ayutaz/piper.unity

I encountered the same stalling issue you mentioned when trying to update the original project, so I created this implementation to address that problem. Feel free to check it out as a reference for your update.

ayutaz avatar Mar 22 '25 04:03 ayutaz

Sentis releases (2.0/2.1)

Compilation was requested for method Unity.Jobs.IJobExtensions+JobStruct1[[Unity.Sentis.CPUBackend+CopyJob1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], Unity.Sentis, Version=2.1.2.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(Unity.Sentis.CPUBackend+CopyJob1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]&, Unity.Sentis, Version=2.1.2.0, Culture=neutral, PublicKeyToken=null|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)` but it is not a known Burst entry point. This may be because the [BurstCompile] method is defined in a generic class, and the generic class is not instantiated with concrete types anywhere in your code.

KeyNotFoundException: The given key '2' was not present in the dictionary. System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <13c0c460649d4ce49f991e2c222fa635>:0) Unity.Sentis.ModelStorage.GetTensor (System.Int32 index) (at ./Library/PackageCache/com.unity.sentis@c51693b52067/Runtime/Core/Backends/ModelStorage.cs:69) Unity.Sentis.Layers.Select.Execute (Unity.Sentis.ExecutionContext ctx) (at ./Library/PackageCache/com.unity.sentis@c51693b52067/Runtime/Core/Layers/Layer.Transformation.cs:1087) Unity.Sentis.Worker+d__25.MoveNext () (at ./Library/PackageCache/com.unity.sentis@c51693b52067/Runtime/Core/Backends/Worker.cs:287) Piper.PiperManager.TextToSpeechAsync (System.String text) (at Assets/Piper/Scripts/PiperManager.cs:77) Piper.PiperSample.OnButtonPressed () (at Assets/Piper/Samples/PiperSample.cs:28) System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) (at <13c0c460649d4ce49f991e2c222fa635>:0) UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <612ea0208cc847f49d539e6511ed3cd5>:0) UnityEngine.UnitySynchronizationContext.Exec () (at <612ea0208cc847f49d539e6511ed3cd5>:0) UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at <612ea0208cc847f49d539e6511ed3cd5>:0)

EricQ360 avatar Mar 23 '25 19:03 EricQ360