From d81ed5601d674737257be839d2a240f54a69ab34 Mon Sep 17 00:00:00 2001 From: Belem Zhang Date: Wed, 11 Oct 2023 11:58:04 +0800 Subject: [PATCH] model path --- src/lib/assets/js/ort_utils.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/assets/js/ort_utils.js b/src/lib/assets/js/ort_utils.js index a3ed71f..059c433 100644 --- a/src/lib/assets/js/ort_utils.js +++ b/src/lib/assets/js/ort_utils.js @@ -106,7 +106,11 @@ const l = (i) => { const getUrlById = (id) => { for (let i = 0; i < models.length; i++) { if (models[i].id === id) { - return models[i].url; + if (location.hostname.indexOf('github.io') > -1) { + return models[i].url.github; + } else { + return `https://${localhost}/` + models[i].url.local; + } } } return null; @@ -274,6 +278,7 @@ const main = async (_id, _model, _modelType, _dataType, _backend) => { updateInfo(`${testQueueLength - testQueue.length + 1}/${testQueueLength} Testing ${_model} (${_modelType}/${_dataType}) with ${backend} backend`); updateInfo(`${testQueueLength - testQueue.length + 1}/${testQueueLength} Creating onnx runtime web inference session ...`); + updateInfo(`${testQueueLength - testQueue.length + 1}/${testQueueLength} Downloading model from ${modelPath}...`); const sess = await ort.InferenceSession.create(modelPath, options); updateInfo(`${testQueueLength - testQueue.length + 1}/${testQueueLength} Warming up ...`); let feeds = clone(getFeeds(_model, _dataType));