Skip to content

Commit

Permalink
TIKA-4239 -- band aid clear the cache for jenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
tballison committed Dec 2, 2024
1 parent 9405ab4 commit 2384816
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.Map;
import java.util.Set;

import org.apache.commons.io.FileUtils;
import org.datavec.image.loader.NativeImageLoader;
import org.deeplearning4j.nn.graph.ComputationGraph;
import org.deeplearning4j.util.ModelSerializer;
Expand Down Expand Up @@ -98,6 +99,10 @@ public void initialize(Map<String, Param> params) throws TikaConfigException {
try {
if (serialize) {
if (cacheDir.exists()) {
FileUtils.deleteDirectory(cacheDir);
}
if (cacheDir.exists()) {
LOG.info("Trying to load preprocessed model from {}", cacheDir);
model = ModelSerializer.restoreComputationGraph(cacheDir);
LOG.info("Preprocessed Model Loaded from {}", cacheDir);
} else {
Expand Down

0 comments on commit 2384816

Please sign in to comment.