code: def test_model_card_trl(
      formatting_func: Callable,
      training_task: Callable,
      feedback_dataset_guidelines: str,
      feedback_dataset_fields: List["AllowedFieldTypes"],
      feedback_dataset_questions: List["AllowedQuestionTypes"],
      feedback_dataset_records: List[FeedbackRecord],
      mocked_is_on_huggingface,
  ) -> None:
      dataset = FeedbackDataset(
          guidelines=feedback_dataset_guidelines,
          fields=feedback_dataset_fields,
          questions=feedback_dataset_questions,
      )
      dataset.add_records(records=feedback_dataset_records * 2)
      task = training_task(formatting_func)
      model_id = "sshleifer/tiny-gpt2"
  
      if training_task == TrainingTask.for_supervised_fine_tuning:
          output_dir = '"sft_model"'
      elif training_task == TrainingTask.for_reward_modeling:
          output_dir = '"rm_model"'
      elif (
          training_task == TrainingTask.for_proximal_policy_optimization
      ):
          output_dir = '"ppo_model"'
      else:
          output_dir = '"dpo_model"'
  
      trainer = ArgillaTrainer(
          dataset=dataset,
          task=task,
          framework="trl",
          model=model_id,
          framework_kwargs={
              "model_card_kwargs": {
                  "license": "mit",
                  "language": ["en", "es"],
                  "dataset_name": DATASET_NAME,
                  "output_dir": output_dir,
              }
          },
      )
      if training_task == TrainingTask.for_proximal_policy_optimization:
          from transformers import pipeline
          from trl import PPOConfig
  
          reward_model = pipeline(
              "sentiment-analysis", model="lvwerra/distilbert-imdb"
          )
          trainer.update_config(
              config=PPOConfig(batch_size=1, ppo_epochs=2),
              reward_model=reward_model,
          )
      else:
          trainer.update_config(max_steps=1)
  
      with TemporaryDirectory() as tmpdirname:
          model_card = trainer.generate_model_card(tmpdirname)
          assert (Path(tmpdirname) / MODEL_CARD_NAME).exists()
          pattern = model_card_pattern(Framework("trl"), 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 4 for calling a global function with example usage: test_model_card_trl(formatting_func, training_task, feedback_dataset_guidelines, feedback_dataset_fields, feedback_dataset_questions, feedback_dataset_records, mocked_is_on_huggingface) without return types