From ed4c088f3c2783835ac646e35fb18b3bea989030 Mon Sep 17 00:00:00 2001 From: carlosuc3m <49989524+carlosuc3m@users.noreply.github.com> Date: Thu, 2 Nov 2023 02:59:29 +0100 Subject: [PATCH] always unzip weigths when downloading --- .../modelrunner/bioimageio/download/DownloadModel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/bioimage/modelrunner/bioimageio/download/DownloadModel.java b/src/main/java/io/bioimage/modelrunner/bioimageio/download/DownloadModel.java index 2637b34c..0e9a4ffe 100644 --- a/src/main/java/io/bioimage/modelrunner/bioimageio/download/DownloadModel.java +++ b/src/main/java/io/bioimage/modelrunner/bioimageio/download/DownloadModel.java @@ -269,9 +269,9 @@ private void addWeights() { WeightFormat w = weights.getWeightsByIdentifier(ww); if (w.getSource() != null && checkURL(w.getSource())) { downloadableLinks.put(WEIGHTS_KEY + "_" + c ++, w.getSource()); + if (w.getSourceFileName().endsWith(".zip")) + unzip = true; } - if (downloadableLinks.get(WEIGHTS_KEY + "_" + (c - 1)).endsWith(".zip")) - unzip = true; } catch (Exception ex) { // The exception is thrown whenever the weight format is not present. // This exception will not be thrown here because the weight formats are retrieved from the same object