UnityGiles
commited on
Commit
·
b3eaf8f
1
Parent(s):
5506035
fix token count issue
Browse files
Assets/Scripts/RunWhisper.cs
CHANGED
@@ -69,7 +69,7 @@ public class RunWhisper : MonoBehaviour
|
|
69 |
outputTokens[1] = ENGLISH;// GERMAN;//FRENCH;//
|
70 |
outputTokens[2] = TRANSCRIBE; //TRANSLATE;//
|
71 |
//outputTokens[3] = NO_TIME_STAMPS;// START_TIME;//
|
72 |
-
tokenCount =
|
73 |
|
74 |
LoadAudio();
|
75 |
EncodeAudio();
|
@@ -164,9 +164,9 @@ public class RunWhisper : MonoBehaviour
|
|
164 |
using var t_Token = await argmax.PeekOutput().ReadbackAndCloneAsync() as Tensor<int>;
|
165 |
int index = t_Token[0];
|
166 |
|
167 |
-
tokenCount++;
|
168 |
outputTokens[tokenCount] = lastToken[0];
|
169 |
lastToken[0] = index;
|
|
|
170 |
tokensTensor.Reshape(new TensorShape(1, tokenCount));
|
171 |
tokensTensor.dataOnBackend.Upload<int>(outputTokens, tokenCount);
|
172 |
lastTokenTensor.dataOnBackend.Upload<int>(lastToken, 1);
|
|
|
69 |
outputTokens[1] = ENGLISH;// GERMAN;//FRENCH;//
|
70 |
outputTokens[2] = TRANSCRIBE; //TRANSLATE;//
|
71 |
//outputTokens[3] = NO_TIME_STAMPS;// START_TIME;//
|
72 |
+
tokenCount = 3;
|
73 |
|
74 |
LoadAudio();
|
75 |
EncodeAudio();
|
|
|
164 |
using var t_Token = await argmax.PeekOutput().ReadbackAndCloneAsync() as Tensor<int>;
|
165 |
int index = t_Token[0];
|
166 |
|
|
|
167 |
outputTokens[tokenCount] = lastToken[0];
|
168 |
lastToken[0] = index;
|
169 |
+
tokenCount++;
|
170 |
tokensTensor.Reshape(new TensorShape(1, tokenCount));
|
171 |
tokensTensor.dataOnBackend.Upload<int>(outputTokens, tokenCount);
|
172 |
lastTokenTensor.dataOnBackend.Upload<int>(lastToken, 1);
|