def _load_model_general(
        self,
        model_class: Any,
        load_function_name: str,
        model_name: str,
        load_kwargs,
        model_kwargs: dict,
    ) -> Any:
        """General function to attempt to load a model."""
        try:
            load_function = getattr(model_class, load_function_name)
            return load_function(model_name, **{**load_kwargs, **model_kwargs})
        except Exception as e:
            logger.error(
                f"Failed to load model using {model_class.__name__}.{load_function_name}: {e}"
            )
General function to attempt to load a model.
llama-index-integrations/llms/llama-index-llms-ipex-llm/llama_index/llms/ipex_llm/base.py