def start_service(self):
        """
        Start the LLM service by loading the model into the chosen pipeline if it's not already loaded.
        Ensures thread-safe loading using a lock.
        """
        with self.load_lock:
            if self.model_type == "hf":
                if self.pipe is None:
                    print(f"Loading Hugging Face model '{self.model_name}' on device '{self.device}'...")
                    self.pipe = pipeline(
                        "text-generation",
                        model=self.model_name,
                        torch_dtype="auto",
                        device_map=self.device
                    )
                    print("Hugging Face model loaded successfully.")
            elif self.model_type == "vllm":
                if self.llm is None:
                    print(f"Loading vLLM model '{self.model_name}' on device '{self.device}'...")
                    self.llm = LLM(self.model_name, tensor_parallel_size=1)
                    print("vLLM model loaded successfully.")
            else:
                raise ValueError("Unsupported model_type. Choose 'hf' for Hugging Face or 'vllm' for vLLM.")

        Start the LLM service by loading the model into the chosen pipeline if it's not already loaded.
        Ensures thread-safe loading using a lock.
        
data/omegaPRM_v2/llm_utils.py