From 1802c28bd205f34e052a6b605a2b924b2f109d80 Mon Sep 17 00:00:00 2001 From: Wanming Lin Date: Tue, 7 May 2024 22:03:40 -0700 Subject: [PATCH] Fix UI issue for image classification (#233) When switch to NPU and choose model directly, it will throw error as the data type doesn't change correspondingly, fix it by clicking the correct data type if switch to NPU or CPU. --- image_classification/main.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/image_classification/main.js b/image_classification/main.js index ce8839b0..2e1cbda9 100644 --- a/image_classification/main.js +++ b/image_classification/main.js @@ -125,10 +125,12 @@ $('#backendBtns .btn').on('change', async (e) => { } else if (deviceType == 'npu') { ui.handleBtnUI('#float16Label', false); ui.handleBtnUI('#float32Label', true); + $('#float16').click(); displayAvailableModels(modelList, deviceType, 'float16'); } else { ui.handleBtnUI('#float16Label', true); ui.handleBtnUI('#float32Label', false); + $('#float32').click(); displayAvailableModels(modelList, deviceType, 'float32'); }