def _load_necessary_components(self):
        """Load the necessary components for the hf model.

        Raises:
            InvalidModelPropertiesError: If the model properties are invalid or incomplete.
        """

        if self.model_properties.name:
            self._model, self._tokenizer = self._load_from_hugging_face_repo()
        elif self.model_properties.url or (
                self.model_properties.model_location and self.model_properties.model_location.s3):
            self._model, self._tokenizer = self._load_from_zip_file()
        elif self.model_properties.model_location and self.model_properties.model_location.hf:
            if self.model_properties.model_location.hf.filename:
                self._model, self._tokenizer = self._load_from_zip_file()
            else:
                self._model, self._tokenizer = self._load_from_private_hugging_face_repo()
        else:
            raise InternalError(f"Invalid model properties: {self.model_properties}. Marqo can not load the model via "
                                f"a specified method. Please check the model properties and try again.")

        self._model = self._model.to(self.device)
        self._pooling_func = self._load_pooling_method()
        self._model.eval()
Load the necessary components for the hf model.

        Raises:
            InvalidModelPropertiesError: If the model properties are invalid or incomplete.
        
src/marqo/inference/native_inference/embedding_models/hugging_face_model.py