Commit d3edbf1b authored by Christopher Jan-Steffen Brix's avatar Christopher Jan-Steffen Brix
Browse files

Use architecture to get the data path which is used for hashing

parent 5905c673
Pipeline #101438 failed with stages
in 1 minute and 2 seconds
......@@ -182,8 +182,7 @@ public class EMADLGenerator {
List<FileContent> fileContentsTrainingHashes = new ArrayList<>();
for (ExpandedComponentInstanceSymbol componentInstance : allInstances) {
ComponentSymbol component = componentInstance.getComponentType().getReferencedSymbol();
Optional<ArchitectureSymbol> architecture = component.getSpannedScope().resolve("", ArchitectureSymbol.KIND);
Optional<ArchitectureSymbol> architecture = componentInstance.getSpannedScope().resolve("", ArchitectureSymbol.KIND);
if(!architecture.isPresent()) {
continue;
......@@ -203,16 +202,15 @@ public class EMADLGenerator {
// This is not the real path to the training data! Adapt accordingly once sub-task 4 is solved
String trainConfigFilename = "NOT_FOUND";
String componentConfigFilename = component.getFullName().replaceAll("\\.", "/");
String instanceConfigFilename = component.getFullName().replaceAll("\\.", "/") + "_" + component.getName();
String componentConfigFilename = componentInstance.getFullName().replaceAll("\\.", "/");
String instanceConfigFilename = componentInstance.getFullName().replaceAll("\\.", "/") + "_" + componentInstance.getName();
if (Files.exists(Paths.get( getModelsPath() + instanceConfigFilename + ".cnnt"))) {
trainConfigFilename = instanceConfigFilename;
}
else if (Files.exists(Paths.get( getModelsPath() + componentConfigFilename + ".cnnt"))){
trainConfigFilename = componentConfigFilename;
}
Path dataPath = Paths.get( getModelsPath() + trainConfigFilename + ".data");
byte[] dataHash = checksum(dataPath);
byte[] dataHash = checksum(Paths.get(architecture.get().getDataPath()));
String trainingHash = creatorScriptHash + "-" + trainerScriptHash + "-" + convertByteArrayToHexString(dataHash);
System.out.println(trainingHash);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment