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 test_resume_train_not_from_ds_checkpoint(self, stage, dtype):
      # do normal training and then resume not from the deepspeed checkpoint but explicitly from
      # the saved model dir
  
      do_train = True
      do_eval = False
      kwargs = dict(
          stage=stage,
          dtype=dtype,
          eval_steps=1,
          distributed=True,
          do_train=do_train,
          do_eval=do_eval,
      )
  
      # 1. normal training
      output_dir = self.run_and_check(**kwargs)
  
      # 2. now resume explicitly from the saved weights, by passing --model_name_or_path output_dir
      # - i.e. the same path the model was saved to in step 1
      output_dir = self.run_trainer(**kwargs, model_name=output_dir)
  
      self.do_checks(output_dir, do_train=do_train, do_eval=do_eval)
  
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 5 for calling the TestDeepSpeedWithLauncher obj's underlying member method code with example usage: obj.test_resume_train_not_from_ds_checkpoint(stage, dtype) without return types