Skip to content

Commit

Permalink
Warn when INFERENCE_CLEAR_RULES set without learning model.
Browse files Browse the repository at this point in the history
  • Loading branch information
dickensc committed May 8, 2024
1 parent aadeb47 commit 2ec4cb2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion psl-java/src/main/java/org/linqs/psl/runtime/Runtime.java
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,11 @@ protected void runInferenceInternal(RuntimeConfig config, Model model, RuntimeRe
}

if (RuntimeOptions.INFERENCE_CLEAR_RULES.getBoolean()) {
model.clear();
if (model == null) {
log.warn("Option {} set, but there is no model from learning.", RuntimeOptions.INFERENCE_CLEAR_RULES.name());
} else {
model.clear();
}
}

// If a model was passed in, then it was learned from the common rules (so don't include them).
Expand Down

0 comments on commit 2ec4cb2

Please sign in to comment.