Skip to content
Snippets Groups Projects
Commit b45366b3 authored by carlosuc3m's avatar carlosuc3m
Browse files

display easy DL versions for the users

parent e03fa9af
No related branches found
No related tags found
No related merge requests found
...@@ -61,7 +61,10 @@ public class AvailableDeepLearningVersions ...@@ -61,7 +61,10 @@ public class AvailableDeepLearningVersions
DeepLearningVersion coinc = nVersions.stream() DeepLearningVersion coinc = nVersions.stream()
.filter(v -> vv.getPythonVersion().equals(v.getPythonVersion())) .filter(v -> vv.getPythonVersion().equals(v.getPythonVersion()))
.collect(Collectors.toList()).get(0); .collect(Collectors.toList()).get(0);
if (coinc != null && coinc.getVersion().replace(".", "")) if (coinc != null && coinc.isJavaVersionBigger(vv))
continue;
else
nVersions.remove(coinc);
nVersions.add(vv); nVersions.add(vv);
} }
return nVersions; return nVersions;
......
...@@ -2,6 +2,7 @@ package plugins.danyfel80.deeplearningdownloader; ...@@ -2,6 +2,7 @@ package plugins.danyfel80.deeplearningdownloader;
import java.awt.event.WindowListener; import java.awt.event.WindowListener;
import java.io.IOException; import java.io.IOException;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -39,12 +40,24 @@ public class DeepLearningVersionSelector extends EzPlug implements EzStoppable, ...@@ -39,12 +40,24 @@ public class DeepLearningVersionSelector extends EzPlug implements EzStoppable,
private final static Map<String, DeepLearningVersion> versions; private final static Map<String, DeepLearningVersion> versions;
static static
{ {
versions = AvailableDeepLearningVersions.loadCompatibleOnly().getVersions().stream() versions = getDisplayMapWithoutPythonRepeated();
}
/**
* Create map to display the available Deep Learning versions for naive users.
* only the DL framework, python version and whether is GPU or CPU
* @return map to let naive users select the wanted DL version
*/
private static Map<String, DeepLearningVersion> getDisplayMapWithoutPythonRepeated() {
List<DeepLearningVersion> allVersions = AvailableDeepLearningVersions.loadCompatibleOnly().getVersions();
List<DeepLearningVersion> vList = AvailableDeepLearningVersions.removeRepeatedPythonVersions(allVersions);
Map<String, DeepLearningVersion> map = vList.stream()
.collect(Collectors.toMap( .collect(Collectors.toMap(
v -> v.getEngine() + "-" + v.getPythonVersion() v -> v.getEngine() + "-" + v.getPythonVersion()
+ (v.getCPU() ? "-" + DeepLearningVersion.cpuKey : "") + (v.getCPU() ? "-" + DeepLearningVersion.cpuKey : "")
+ (v.getGPU() ? "-" + DeepLearningVersion.gpuKey : ""), + (v.getGPU() ? "-" + DeepLearningVersion.gpuKey : ""),
Function.identity())); Function.identity()));
return map;
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment