From 27d1dfc77ccee5230e52c2c3b694681d00ff46e4 Mon Sep 17 00:00:00 2001 From: Frank Liu Date: Wed, 9 Nov 2022 12:45:48 -0800 Subject: [PATCH] [api] Allows non-ServingTranslatorFactory for DJLServing --- .../main/java/ai/djl/translate/ServingTranslatorFactory.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api/src/main/java/ai/djl/translate/ServingTranslatorFactory.java b/api/src/main/java/ai/djl/translate/ServingTranslatorFactory.java index dfaa514f8ff..ae728a981de 100644 --- a/api/src/main/java/ai/djl/translate/ServingTranslatorFactory.java +++ b/api/src/main/java/ai/djl/translate/ServingTranslatorFactory.java @@ -72,9 +72,7 @@ public Translator newInstance( String factoryClass = ArgumentsUtil.stringValue(arguments, "translatorFactory"); if (factoryClass != null && !factoryClass.isEmpty()) { TranslatorFactory factory = loadTranslatorFactory(factoryClass); - if (factory != null - && !(factory instanceof ServingTranslatorFactory) - && factory.isSupported(input, output)) { + if (factory != null && factory.isSupported(input, output)) { logger.info("Using TranslatorFactory: {}", factory.getClass().getName()); return factory.newInstance(input, output, model, arguments); }