Closed harryradford closed 11 months ago
I believe this is because of create react app, which others have also had problems with. For more information, see https://github.com/xenova/transformers.js/issues/185
Is there a reason you have to use CRA? These days, it is generally not considered to be a good build tool. I recommend Vite instead.
Alternatively, if you are forced to use CRA for some reason, you can import the pre-built version from jsdelivr (or other CDN):
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers@2.4.4';
Switching from CRA to Vite resolved the issue.
During development, the
decoder_model_merged.onnx
andencoder_model.onnx
models are fetched fine from Hugging Face or from my Express server. After building the React app with Create React App, transformers.js is trying to fetchmodel.onnx
which cannot be found.My pipeline options are
{ progress_callback, revision: "output_attentions", quantized: false }
. The task is "automatic-speech-recognition" and the model is "Xenova/whisper-tiny.en". @xenova What ismodel.onnx
?