public static AbstractPredictor getCustomPredictor(DJLEndpoint endpoint) {
        String applicationPath = endpoint.getApplication();

        // CV
        if (applicationPath.equals(IMAGE_CLASSIFICATION.getPath())) {
            return new CustomCvPredictor<Classifications>(endpoint);
        } else if (applicationPath.equals(OBJECT_DETECTION.getPath())) {
            return new CustomCvPredictor<DetectedObjects>(endpoint);
        } else if (SEMANTIC_SEGMENTATION.getPath().equals(applicationPath)) {
            return new CustomCvPredictor<CategoryMask>(endpoint);
        } else if (INSTANCE_SEGMENTATION.getPath().equals(applicationPath)) {
            return new CustomCvPredictor<DetectedObjects>(endpoint);
        } else if (POSE_ESTIMATION.getPath().equals(applicationPath)) {
            return new CustomCvPredictor<Joints>(endpoint);
        } else if (ACTION_RECOGNITION.getPath().equals(applicationPath)) {
            return new CustomCvPredictor<Classifications>(endpoint);
        } else if (WORD_RECOGNITION.getPath().equals(applicationPath)) {
            return new CustomCvPredictor<String>(endpoint);
        } else if (IMAGE_GENERATION.getPath().equals(applicationPath)) {
            return new CustomImageGenerationPredictor(endpoint);
        } else if (IMAGE_ENHANCEMENT.getPath().equals(applicationPath)) {
            return new CustomCvPredictor<Image>(endpoint);
        }

        // NLP
        if (FILL_MASK.getPath().equals(applicationPath)) {
            return new CustomNlpPredictor<String[]>(endpoint);
        } else if (QUESTION_ANSWER.getPath().equals(applicationPath)) {
            return new CustomQuestionAnswerPredictor(endpoint);
        } else if (TEXT_CLASSIFICATION.getPath().equals(applicationPath)) {
            return new CustomNlpPredictor<Classifications>(endpoint);
        } else if (SENTIMENT_ANALYSIS.getPath().equals(applicationPath)) {
            return new CustomNlpPredictor<Classifications>(endpoint);
        } else if (TOKEN_CLASSIFICATION.getPath().equals(applicationPath)) {
            return new CustomNlpPredictor<Classifications>(endpoint);
        } else if (WORD_EMBEDDING.getPath().equals(applicationPath)) {
            return new CustomWordEmbeddingPredictor(endpoint);
        } else if (TEXT_GENERATION.getPath().equals(applicationPath)) {
            return new CustomNlpPredictor<String>(endpoint);
        } else if (MACHINE_TRANSLATION.getPath().equals(applicationPath)) {
            return new CustomNlpPredictor<String>(endpoint);
        } else if (MULTIPLE_CHOICE.getPath().equals(applicationPath)) {
            return new CustomNlpPredictor<String>(endpoint);
        } else if (TEXT_EMBEDDING.getPath().equals(applicationPath)) {
            return new CustomNlpPredictor<NDArray>(endpoint);
        }

        // Tabular
        if (LINEAR_REGRESSION.getPath().equals(applicationPath)) {
            return new CustomTabularPredictor(endpoint);
        } else if (SOFTMAX_REGRESSION.getPath().equals(applicationPath)) {
            return new CustomTabularPredictor(endpoint);
        }

        // Audio
        if (Application.Audio.ANY.getPath().equals(applicationPath)) {
            return new CustomAudioPredictor(endpoint);
        }

        // Time Series
        if (FORECASTING.getPath().equals(applicationPath)) {
            return new CustomForecastingPredictor(endpoint);
        }

        throw new RuntimeCamelException("Application not supported: " + applicationPath);
    }
@Test
    void testGetCustomPredictor() {
        var modelName = "MyModel";
        var translatorName = "MyTranslator";

        // CV
        assertInstanceOf(CustomCvPredictor.class,
                getCustomPredictor(customEndpoint("cv/image_classification", modelName, translatorName)));
        assertInstanceOf(CustomCvPredictor.class,
                getCustomPredictor(customEndpoint("cv/object_detection", modelName, translatorName)));
        assertInstanceOf(CustomCvPredictor.class,
                getCustomPredictor(customEndpoint("cv/semantic_segmentation", modelName, translatorName)));
        assertInstanceOf(CustomCvPredictor.class,
                getCustomPredictor(customEndpoint("cv/instance_segmentation", modelName, translatorName)));
        assertInstanceOf(CustomCvPredictor.class,
                getCustomPredictor(customEndpoint("cv/pose_estimation", modelName, translatorName)));
        assertInstanceOf(CustomCvPredictor.class,
                getCustomPredictor(customEndpoint("cv/action_recognition", modelName, translatorName)));
        assertInstanceOf(CustomCvPredictor.class,
                getCustomPredictor(customEndpoint("cv/word_recognition", modelName, translatorName)));
        assertInstanceOf(CustomImageGenerationPredictor.class,
                getCustomPredictor(customEndpoint("cv/image_generation", modelName, translatorName)));
        assertInstanceOf(CustomCvPredictor.class,
                getCustomPredictor(customEndpoint("cv/image_enhancement", modelName, translatorName)));

        // NLP
        assertInstanceOf(CustomNlpPredictor.class,
                getCustomPredictor(customEndpoint("nlp/fill_mask", modelName, translatorName)));
        assertInstanceOf(CustomQuestionAnswerPredictor.class,
                getCustomPredictor(customEndpoint("nlp/question_answer", modelName, translatorName)));
        assertInstanceOf(CustomNlpPredictor.class,
                getCustomPredictor(customEndpoint("nlp/text_classification", modelName, translatorName)));
        assertInstanceOf(CustomNlpPredictor.class,
                getCustomPredictor(customEndpoint("nlp/sentiment_analysis", modelName, translatorName)));
        assertInstanceOf(CustomNlpPredictor.class,
                getCustomPredictor(customEndpoint("nlp/token_classification", modelName, translatorName)));
        assertInstanceOf(CustomWordEmbeddingPredictor.class,
                getCustomPredictor(customEndpoint("nlp/word_embedding", modelName, translatorName)));
        assertInstanceOf(CustomNlpPredictor.class,
                getCustomPredictor(customEndpoint("nlp/text_generation", modelName, translatorName)));
        assertInstanceOf(CustomNlpPredictor.class,
                getCustomPredictor(customEndpoint("nlp/machine_translation", modelName, translatorName)));
        assertInstanceOf(CustomNlpPredictor.class,
                getCustomPredictor(customEndpoint("nlp/multiple_choice", modelName, translatorName)));
        assertInstanceOf(CustomNlpPredictor.class,
                getCustomPredictor(customEndpoint("nlp/text_embedding", modelName, translatorName)));

        // Tabular
        assertInstanceOf(CustomTabularPredictor.class,
                getCustomPredictor(customEndpoint("tabular/linear_regression", modelName, translatorName)));
        assertInstanceOf(CustomTabularPredictor.class,
                getCustomPredictor(customEndpoint("tabular/softmax_regression", modelName, translatorName)));

        // Audio
        assertInstanceOf(CustomAudioPredictor.class,
                getCustomPredictor(customEndpoint("audio", modelName, translatorName)));

        // Time Series
        assertInstanceOf(CustomForecastingPredictor.class,
                getCustomPredictor(customEndpoint("timeseries/forecasting", modelName, translatorName)));
    }