class_docstr: This class is for testing via an external script - can do multiple gpus
class_docstr_tok: ["This","class","is","for","testing","via","an","external","script","-","can","do","multiple","gpus"]
code: def do_checks(
      self, output_dir, do_train=True, do_eval=True, quality_checks=True
  ):
      if do_train:
          train_metrics = load_json(
              os.path.join(output_dir, "train_results.json")
          )
          self.assertIn("train_samples_per_second", train_metrics)
          if quality_checks:
              self.assertGreater(
                  train_metrics["train_samples_per_second"], 0.5
              )
  
      if do_eval:
          eval_metrics = load_json(
              os.path.join(output_dir, "eval_results.json")
          )
          self.assertIn("eval_bleu", eval_metrics)
          if quality_checks:
              self.assertGreater(eval_metrics["eval_bleu"], 1)
  
imports: import dataclasses
  import io
  import itertools
  import json
  import os
  import unittest
  from copy import deepcopy
  import datasets
  from parameterized import parameterized
  from tests.trainer.test_trainer import TrainerIntegrationCommon
  from transformers import AutoModel, TrainingArguments, is_torch_available, logging
  from transformers.deepspeed import HfDeepSpeedConfig, is_deepspeed_available, unset_hf_deepspeed_config
  from transformers.testing_utils import CaptureLogger, CaptureStd, CaptureStderr, LoggingLevel, TestCasePlus, execute_subprocess_async, get_gpu_count, mockenv_context, require_deepspeed, require_optuna, require_torch_gpu, require_torch_multi_gpu, slow
  from transformers.trainer_utils import get_last_checkpoint, set_seed
  from transformers.utils import WEIGHTS_NAME, is_torch_bf16_gpu_available
label_desc: Use image node_id 7 for calling the TestDeepSpeedWithLauncher obj's underlying member method code with example usage: obj.do_checks(output_dir, do_train, do_eval, quality_checks) without return types