def generate_model_card(self, output_dir: Optional[str] = None) -> "ArgillaModelCard":
        """Generate and return a model card based on the model card data.

        Args:
            output_dir: If given, folder where the model card will be written.

        Returns:
            model_card: The model card.
        """
        from argilla_v1.client.feedback.integrations.huggingface.model_card import ArgillaModelCard

        if not self.model_card_kwargs.get("output_dir"):
            self.model_card_kwargs.update({"output_dir": f'"{output_dir}"'})

        model_card = ArgillaModelCard.from_template(
            card_data=self._trainer.get_model_card_data(**self.model_card_kwargs),
            template_path=ArgillaModelCard.default_template_path,
        )

        if output_dir:
            model_card_path = Path(output_dir) / "README.md"
            model_card.save(model_card_path)
            self._logger.info(f"Model card generated at: {model_card_path}")

        return model_card
Generate and return a model card based on the model card data.

        Args:
            output_dir: If given, folder where the model card will be written.

        Returns:
            model_card: The model card.
        
argilla-v1/src/argilla_v1/client/feedback/training/base.py