diff --git a/src/main/java/io/bioimage/modelrunner/bioimageio/download/DownloadTracker.java b/src/main/java/io/bioimage/modelrunner/bioimageio/download/DownloadTracker.java index 2f0b0004..a1a67691 100644 --- a/src/main/java/io/bioimage/modelrunner/bioimageio/download/DownloadTracker.java +++ b/src/main/java/io/bioimage/modelrunner/bioimageio/download/DownloadTracker.java @@ -153,6 +153,7 @@ private DownloadTracker(String folder, TwoParameterConsumer cons this.consumer = consumer; this.remainingFiles = sizeFiles.keySet().stream().map(i -> new File(i)).collect(Collectors.toList()); this.downloadThread = thread; + this.consumer.accept(TOTAL_PROGRESS_KEY, 0.0); } @@ -526,6 +527,8 @@ public static void printProgress(Thread downloadThread, continue; } for (String kk : new String[] {select, DownloadTracker.TOTAL_PROGRESS_KEY}) { + if (kk.endsWith(EngineInstall.NBYTES_SUFFIX)) + continue; int nProgressBar = (int) (consumer.get().get(kk) * n); String progressStr = new File(kk).getName() + ": [" + ogProgressStr.substring(0, nProgressBar) + ogRemainingStr.substring(nProgressBar) diff --git a/src/main/java/io/bioimage/modelrunner/versionmanagement/DeepLearningVersion.java b/src/main/java/io/bioimage/modelrunner/versionmanagement/DeepLearningVersion.java index 719be511..004e2776 100644 --- a/src/main/java/io/bioimage/modelrunner/versionmanagement/DeepLearningVersion.java +++ b/src/main/java/io/bioimage/modelrunner/versionmanagement/DeepLearningVersion.java @@ -67,9 +67,6 @@ public class DeepLearningVersion * and implies that the user has manipulated wrongly the engines */ public static DeepLearningVersion fromFile(File engineDir) throws IOException, IllegalStateException { - if (!engineDir.isDirectory()) - throw new IOException("The file '" + engineDir.getAbsolutePath() + "' does not correspond " - + "to an existing directory."); DeepLearningVersion dlVersion = new DeepLearningVersion(); dlVersion.engineName = engineDir.getName(); dlVersion.allEnginesDir = engineDir.getParentFile().getAbsolutePath();