shreyask commited on
Commit
840c59c
·
verified ·
1 Parent(s): 6c55ed7

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. src/worker.ts +3 -2
src/worker.ts CHANGED
@@ -86,8 +86,9 @@ async function loadModel(repoId: string) {
86
  // Load voices (.npz) and ONNX model in parallel
87
  self.postMessage({ type: "status", message: "Downloading model & voices..." });
88
 
89
- // onnx-community repos have model at onnx/model.onnx, original repos use config.model_file
90
- const modelFile = config.model_file || "onnx/model.onnx";
 
91
  const modelUrl = resolveUrl(repoId, modelFile);
92
 
93
  const modelPromise = (async () => {
 
86
  // Load voices (.npz) and ONNX model in parallel
87
  self.postMessage({ type: "status", message: "Downloading model & voices..." });
88
 
89
+ // onnx-community repos store the model at onnx/model.onnx
90
+ const isOnnxCommunity = repoId.startsWith("onnx-community/");
91
+ const modelFile = isOnnxCommunity ? "onnx/model.onnx" : config.model_file;
92
  const modelUrl = resolveUrl(repoId, modelFile);
93
 
94
  const modelPromise = (async () => {