def train(self, output_dir: str = None) -> None:
        """
        We create an openai.FineTune object from a pre-trained model, and send data to finetune it.
        """

        import openai

        if output_dir is not None:
            self.trainer_kwargs["suffix"] = output_dir

        if self._train_dataset is not None and self.trainer_kwargs["training_file"] is None:
            self.trainer_kwargs["training_file"] = self.upload_dataset_to_openai(
                self._train_dataset, "data_train.jsonl"
            )
        if (self._eval_dataset is not None and self.trainer_kwargs["validation_file"] is None) and self.trainer_kwargs[
            "compute_classification_metrics"
        ]:
            self.trainer_kwargs["validation_file"] = self.upload_dataset_to_openai(
                self._eval_dataset, "data_test.jsonl"
            )

        self.update_config()

        started_training = False
        while not started_training:
            try:
                if self.__legacy:
                    response = openai.FineTune.create(
                        **self.trainer_kwargs,
                    )
                else:
                    response = openai.FineTuningJob.create(**self.trainer_kwargs)
                started_training = True
            except Exception as e:
                self._logger.warning(e)
                self._logger.warning(f"Retrying in {self.sleep_timer} seconds.")

                time.sleep(self.sleep_timer)

        self._logger.info(response)
        self.finetune_id = response.id

        if self.__legacy:
            message = f"`openai.FineTune.retrieve('{self.finetune_id}')`"
        else:
            message = f"`openai.FineTuningJob.retrieve('{self.finetune_id}')`"
        self._logger.info(f"Waiting for training OpenAI will send an email when done. Get info by running: {message}.")

        We create an openai.FineTune object from a pre-trained model, and send data to finetune it.
        
argilla-v1/src/argilla_v1/training/openai.py