Need help with model initialization
#4
by
Alfej136
- opened
I have written the following code to load the model in my typescript file, But I am not able to load the model
useEffect(() => {
const loadModel = async () => {
try {
console.log("Loading Whisper model...");
// Initialize the ASR pipeline with Whisper tiny.en model
const transcriber = await pipeline(
'automatic-speech-recognition',
'Xenova/whisper-tiny.en',
{ quantized: false }
);
whisperModelRef.current = transcriber;
console.log("Whisper model loaded successfully");
} catch (error) {
console.error("Error loading Whisper model:", error);
}
};