code: def __init__(
      self, model_name_or_path: str, auth_token: str = None
  ) -> None:
      self.model_name_or_path = model_name_or_path
      self.model_config = AutoConfig.from_pretrained(
          self.model_name_or_path
      )
      if hasattr(self.model_config, "max_position_embeddings"):
          self.model_config.max_seq_length = (
              self.model_config.max_position_embeddings
          )
      else:
          try:
              generation_config = GenerationConfig.from_pretrained(
                  self.model_name_or_path
              )
              self.model_config.max_seq_length = (
                  generation_config.max_length
              )
          except OSError:
              self.model_config.max_seq_length = 2048
  
file_path: deepspeed-mii/tests/test_model_support.py
imports: import pytest
  import deepspeed
  import torch
  from deepspeed.inference.v2.checkpoint import CheckpointEngineBase, HuggingFaceCheckpointEngine
  from transformers import AutoConfig, AutoModel, GenerationConfig
  from typing import Iterable, Tuple
label_desc: Use image node_id 1 to create a new RandomWeightsCheckpointEngine object from inherited base classes: CheckpointEngineBase with example: obj = RandomWeightsCheckpointEngine(model_name_or_path, auth_token)