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); }