batch_size = 32
        input_obj = Inputs(pat=pat)
        try:
            for i in range(0, len(prompts), batch_size):
                batch = prompts[i : i + batch_size]
                input_batch = [
                    input_obj.get_text_input(input_id=str(id), raw_text=inp)
                    for id, inp in enumerate(batch)
                ]
                (
                    inference_params := {}
                ) if inference_params is None else inference_params
                predict_response = _model_init.predict(
                    inputs=input_batch, inference_params=inference_params
                )
            for output in predict_response.outputs:
                if stop is not None:
                    text = enforce_stop_tokens(output.data.text.raw, stop)
                else:
                    text = output.data.text.raw
                generations.append([Generation(text=text)])
        except Exception as e:
            logger.error(f"Predict failed, exception: {e}")
        return LLMResult(generations=generations)