def load_model(self, rank: int = None, cache_model: bool = True) -> "torch.nn.Module":
        """Load the model from the model path."""
        if self.model:
            model = self.model
        else:
            model = load_model_from_task(self.task, self.model_path, **self.get_load_kwargs())

            # we only have peft adapters for now
            if self.adapter_path:
                from peft import PeftModel

                model = PeftModel.from_pretrained(model, self.adapter_path)

        self.model = model if cache_model else None

        return model
Load the model from the model path.
olive/model/handler/hf.py