code: def __init__(self, config, weights):
      super().__init__(config)
      if not config.tie_word_embeddings:
          raise ValueError(
              "MPTForCausalLM only supports tied word embeddings"
          )
      self.transformer = MPTModel(config, weights)
      self.lm_head = TensorParallelHead.load(
          config, prefix="transformer.wte", weights=weights
      )
      self.logit_scale = None
      if config.logit_scale is not None:
          logit_scale = config.logit_scale
          if isinstance(logit_scale, str):
              if logit_scale == "inv_sqrt_d_model":
                  logit_scale = 1 / math.sqrt(config.d_model)
              else:
                  raise ValueError(
                      f"logit_scale={logit_scale!r} is not recognized as an option; use numeric value or 'inv_sqrt_d_model'."
                  )
          self.logit_scale = logit_scale
  
imports: import math
  import os
  import warnings
  from typing import List, Optional, Tuple, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from transformers import PreTrainedModel, PreTrainedTokenizer, PreTrainedTokenizerFast
  from transformers.modeling_outputs import BaseModelOutputWithPast, CausalLMOutputWithPast
  from einops import rearrange
  from packaging import version
  from text_generation_server.utils.layers import TensorParallelEmbedding, TensorParallelColumnLinear, TensorParallelRowLinear, TensorParallelHead, get_linear
label_desc: Use image node_id 1 to create a new MPTForCausalLM object from inherited base classes: MPTPreTrainedModel with example: obj = MPTForCausalLM(config, weights)