From 6beb6bd57f008718b4536f5c8725381a1a6ab945 Mon Sep 17 00:00:00 2001 From: Frank Liu Date: Thu, 25 Aug 2022 14:51:38 -0700 Subject: [PATCH] [api] Fixes bug in Criteria (#1964) Fixes #1961 Change-Id: Ic3b1ca69ddbfffc030a9f301ca129d4ee7fedd2b --- api/src/main/java/ai/djl/repository/zoo/Criteria.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api/src/main/java/ai/djl/repository/zoo/Criteria.java b/api/src/main/java/ai/djl/repository/zoo/Criteria.java index c8e528d3ad12..0c7965240be8 100644 --- a/api/src/main/java/ai/djl/repository/zoo/Criteria.java +++ b/api/src/main/java/ai/djl/repository/zoo/Criteria.java @@ -406,12 +406,13 @@ public static final class Builder { Block block; String modelName; Progress progress; - private Translator translator; + Translator translator; Builder() { application = Application.UNDEFINED; } + @SuppressWarnings("unchecked") private Builder(Class inputClass, Class outputClass, Builder parent) { this.inputClass = inputClass; this.outputClass = outputClass; @@ -419,12 +420,16 @@ private Builder(Class inputClass, Class outputClass, Builder parent) engine = parent.engine; device = parent.device; groupId = parent.groupId; + artifactId = parent.artifactId; + modelZoo = parent.modelZoo; filters = parent.filters; arguments = parent.arguments; options = parent.options; + factory = parent.factory; block = parent.block; modelName = parent.modelName; progress = parent.progress; + translator = (Translator) parent.translator; } /**