code: def test_model_card_with_defaults(
      framework: Union[Framework, str],
      training_task: str,
      feedback_dataset_guidelines: str,
      feedback_dataset_fields: List["AllowedFieldTypes"],
      feedback_dataset_questions: List["AllowedQuestionTypes"],
      feedback_dataset_records: List[FeedbackRecord],
      mocked_is_on_huggingface,
  ) -> None:
      # This test is almost a copy from the one in `test_trainer.py`, it's separated for
      # simplicity, but for speed we should test this at the same trainer.
  
      dataset = FeedbackDataset(
          guidelines=feedback_dataset_guidelines,
          fields=feedback_dataset_fields,
          questions=feedback_dataset_questions,
      )
      dataset.add_records(records=feedback_dataset_records * 2)
  
      questions = [
          question
          for question in dataset.questions
          if isinstance(question, (LabelQuestion, MultiLabelQuestion))
      ]
      label = LabelQuestionUnification(question=questions[0])
  
      if training_task == TrainingTask.for_question_answering:
          task = TrainingTask.for_question_answering(
              question=dataset.field_by_name("label"),
              context=dataset.field_by_name("text"),
              answer=dataset.question_by_name("question-1"),
          )
          output_dir = '"question_answering_model"'
      elif training_task == TrainingTask.for_text_classification:
          task = TrainingTask.for_text_classification(
              text=dataset.fields[0], label=label
          )
          output_dir = '"text_classification_model"'
  
      if framework == Framework("spacy"):
          model = "en_core_web_sm"
      elif framework == Framework("setfit"):
          model = "all-MiniLM-L6-v2"
      else:
          model = "prajjwal1/bert-tiny"
  
      if framework == Framework("span_marker"):
          with pytest.raises(
              NotImplementedError,
              match=f"^Framework span_marker is not supported for this",
          ):
              trainer = ArgillaTrainer(
                  dataset=dataset,
                  task=task,
                  framework=framework,
                  model=model,
                  framework_kwargs={
                      "model_card_kwargs": {
                          "license": "mit",
                          "language": ["en", "es"],
                          "dataset_name": DATASET_NAME,
                      }
                  },
              )
          return
      else:
          trainer = ArgillaTrainer(
              dataset=dataset,
              task=task,
              framework=framework,
              model=model,
              framework_kwargs={
                  "model_card_kwargs": {
                      "license": "mit",
                      "language": ["en", "es"],
                      "dataset_name": DATASET_NAME,
                      "output_dir": output_dir,
                  },
              },
          )
  
      if framework in [
          Framework("spacy"),
          Framework("spacy-transformers"),
      ]:
          trainer.update_config(max_steps=1)
      elif framework in [
          Framework("transformers"),
          Framework("setfit"),
      ]:
          trainer.update_config(num_iterations=1)
  
      with TemporaryDirectory() as tmpdirname:
          model_card = trainer.generate_model_card(tmpdirname)
          assert (Path(tmpdirname) / MODEL_CARD_NAME).exists()
          pattern = model_card_pattern(framework, training_task)
          assert model_card.content.find(pattern) > -1
  
file_path: argilla/tests/integration/client/feedback/integrations/huggingface/test_model_card.py
imports: from pathlib import Path
  from tempfile import TemporaryDirectory
  from typing import TYPE_CHECKING, Callable, List, Union
  import pytest
  from argilla.client.feedback.schemas import FeedbackRecord, LabelQuestion, MultiLabelQuestion
  from argilla.client.feedback.unification import LabelQuestionUnification
  from argilla.client.models import Framework
  from argilla.feedback import ArgillaTrainer, FeedbackDataset, TrainingTask
  from tests.integration.client.feedback.helpers import formatting_func_chat_completion, formatting_func_dpo, formatting_func_ppo, formatting_func_rm, formatting_func_sentence_transformers, formatting_func_sft, model_card_pattern
label_desc: Use image node_id 1 for calling a global function with example usage: test_model_card_with_defaults(framework, training_task, feedback_dataset_guidelines, feedback_dataset_fields, feedback_dataset_questions, feedback_dataset_records, mocked_is_on_huggingface) without return types