Skip to content

Commit 823e86a

Browse files
author
Mateusz Kopciński
committed
changed isModelReady to isReady
1 parent ca02d17 commit 823e86a

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

examples/speech-to-text/screens/SpeechToTextScreen.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ const float32ArrayFromPCMBinaryBuffer = (b64EncodedBuffer: string) => {
4343

4444
export const SpeechToTextScreen = () => {
4545
const {
46-
isModelGenerating,
47-
isModelReady,
46+
isGenerating,
47+
isReady,
4848
downloadProgress,
4949
sequence,
5050
error,
@@ -74,9 +74,9 @@ export const SpeechToTextScreen = () => {
7474
};
7575

7676
const buttonDisabled =
77-
modalVisible || isModelGenerating || !isModelReady || isRecording;
77+
modalVisible || isGenerating || !isReady || isRecording;
7878
const recordingButtonDisabled =
79-
modalVisible || !isModelReady || DeviceInfo.isEmulatorSync();
79+
modalVisible || !isReady || DeviceInfo.isEmulatorSync();
8080

8181
return (
8282
<>
@@ -114,7 +114,7 @@ export const SpeechToTextScreen = () => {
114114
}
115115
>
116116
{sequence ||
117-
(isModelGenerating && 'Transcribing...') ||
117+
(isGenerating && 'Transcribing...') ||
118118
'Start transcription...'}
119119
</Text>
120120
</View>
@@ -179,7 +179,7 @@ export const SpeechToTextScreen = () => {
179179
]}
180180
>
181181
<TouchableOpacity
182-
disabled={recordingButtonDisabled || isModelGenerating}
182+
disabled={recordingButtonDisabled || isGenerating}
183183
style={[
184184
styles.recordingButton,
185185
recordingButtonDisabled && {

src/hooks/natural_language_processing/useSpeechToText.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { SpeechToTextController } from '../../controllers/SpeechToTextController
33
import { ResourceSource } from '../../types/common';
44

55
interface SpeechToTextModule {
6-
isModelReady: boolean;
7-
isModelGenerating: boolean;
6+
isReady: boolean;
7+
isGenerating: boolean;
88
sequence: string;
99
downloadProgress: number;
1010
error: Error | undefined;
@@ -61,8 +61,8 @@ export const useSpeechToText = ({
6161
}, [model, modelName, encoderSource, decoderSource, tokenizerSource]);
6262

6363
return {
64-
isModelReady: isReady,
65-
isModelGenerating: isGenerating,
64+
isReady,
65+
isGenerating,
6666
downloadProgress,
6767
sequence: sequence,
6868
error: error,

0 commit comments

Comments
 (0)