Skip to content

Commit

Permalink
revert model extractions
Browse files Browse the repository at this point in the history
  • Loading branch information
Alextopher committed Sep 19, 2024
1 parent 4836e63 commit 2e6265e
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public Optional<Model> getDefaultModel() {
if (supportedBackends.isEmpty()) {
return Optional.empty();
}

return models.get(supportedBackends.get(0)).stream().findFirst();
}

Expand Down Expand Up @@ -288,10 +289,17 @@ public void extractModels(File modelsDirectory) {
Path outputPath =
modelsDirectory.toPath().resolve(entry.getName().substring(resource.length() + 1));

logger.info("Extracting DNN resource: " + entry.getName());
if (Files.exists(outputPath)) {
logger.info("Skipping extraction of DNN resource: " + entry.getName());
continue;
}

Files.createDirectories(outputPath.getParent());
try (InputStream inputStream = jarFile.getInputStream(entry)) {
Files.copy(inputStream, outputPath, StandardCopyOption.REPLACE_EXISTING);
logger.info("Extracted DNN resource: " + entry.getName());
} catch (IOException e) {
logger.error("Failed to extract DNN resource: " + entry.getName(), e);
}
}
}
Expand Down

0 comments on commit 2e6265e

Please sign in to comment.