async def run_model(self, model_name, input_data, draw, predict_batch):
        """
        Loads the model in case it was never loaded and calls the inference engine class to get a prediction.
        :param model_name: Model name
        :param input_data: Batch of images or a single image
        :param draw: Boolean to specify if we need to draw the response on the input image
        :param predict_batch: Boolean to specify if there is a batch of images in a request or not
        :return: Model response in case draw was set to False, else an actual image
        """
        if re.match(r'[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}', model_name,
                    flags=0):
            for key, value in self.models_hash_dict.items():
                if value == model_name:
                    model_name = key
        if self.model_loaded(model_name):
            try:
                if predict_batch:
                    return await self.models_dict[model_name].run_batch(input_data, draw, predict_batch)
                else:
                    if not draw:
                        return await self.models_dict[model_name].infer(input_data, draw, predict_batch)
                    else:
                        await self.models_dict[model_name].infer(input_data, draw, predict_batch)
            except ApplicationError as e:
                raise e
        else:
            try:
                self.load_model(model_name)
                return await self.run_model(model_name, input_data, draw, predict_batch)
            except ApplicationError as e:
                raise e

        Loads the model in case it was never loaded and calls the inference engine class to get a prediction.
        :param model_name: Model name
        :param input_data: Batch of images or a single image
        :param draw: Boolean to specify if we need to draw the response on the input image
        :param predict_batch: Boolean to specify if there is a batch of images in a request or not
        :return: Model response in case draw was set to False, else an actual image
        
inference_api/src/main/deep_learning_service.py