Closed stinoga closed 3 weeks ago
Found the solve for this! Including the fix in case anyone else runs into it. Needed to match the directory structure to the model_id
value:
this.model_id = "onnx-community/whisper-base";
models/onnx-community/whisper-base/config.json
models/onnx-community/whisper-base/generation_config.json
models/onnx-community/whisper-base/preprocessor_config.json
models/onnx-community/whisper-base/tokenizer_config.json
models/onnx-community/whisper-base/tokenizer.json
models/onnx-community/whisper-base/onnx/decoder_model_merged_q4.onnx
models/onnx-community/whisper-base/onnx/encoder_model.onnx
Question
I realize there's been a lot of talk about this in other issues, but I'm trying to gather if getting local-only model and wasm files will work with Create React App. I'm using
WhisperForConditionalGeneration
from@huggingface/transformers
version3.0.0-alpha.9
.My setup:
... and in my
{packagename}/public/models
folder I've got:This returns the
SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
error that has been discussed in other issues. If I setenv.allowRemoteModels = true;
andenv.allowLocalModels = false;
, and clear my application cache, this works fine. My questions on that:wasm
file to load locally only? It caches fine and calls locally ( http://localhost:3000/dictation/ort-wasm-simd-threaded.jsep.wasm) after the initial CDN call, but I don't want to rely on an external CDN.Thanks! Sorry for the long-winded question. Happy to provide any more code if needed.