def push_to_hub(self, repo_id: Any = None) -> None:
        """
        Saves the model and tokenizer to HuggingFace hub.
        """
        if repo_id is not None:
            try:
                self.model.model.push_to_hub(repo_id=repo_id)
                self.model.tokenizer.push_to_hub(repo_id=repo_id)

            except ValueError:
                raise ValueError(
                    "HuggingFace CLI/Hub login not "
                    "completed provide token to login using"
                    "huggingface_hub.login() see this "
                    "https://huggingface.co/docs/transformers/model_sharing#share-a-model"
                )
        else:
            raise ValueError("No value provided for repo_id")

        Saves the model and tokenizer to HuggingFace hub.
        
llama-index-finetuning/llama_index/finetuning/cross_encoders/cross_encoder.py