code: def __init__(
      self,
      model_id: str,
      revision: Optional[str] = None,
      quantize: Optional[str] = None,
      dtype: Optional[torch.dtype] = None,
      trust_remote_code: bool = False,
  ):
      if torch.cuda.is_available():
          device = torch.device("cuda")
          dtype = torch.float16 if dtype is None else dtype
      else:
          if quantize:
              raise ValueError("quantization is not available on CPU")
  
          device = torch.device("cpu")
          dtype = torch.float32 if dtype is None else dtype
  
      model = AutoModelForSeq2SeqLM.from_pretrained(
          model_id,
          revision=revision,
          torch_dtype=dtype,
          device_map="auto"
          if torch.cuda.is_available() and torch.cuda.device_count() > 1
          else None,
          load_in_8bit=quantize == "bitsandbytes",
          trust_remote_code=trust_remote_code,
      )
      if torch.cuda.is_available() and torch.cuda.device_count() == 1:
          model = model.cuda()
  
      tokenizer = AutoTokenizer.from_pretrained(
          model_id,
          revision=revision,
          padding_side="left",
          truncation_side="left",
          trust_remote_code=trust_remote_code,
      )
      tokenizer.bos_token_id = model.config.decoder_start_token_id
  
      super(Seq2SeqLM, self).__init__(
          model=model,
          tokenizer=tokenizer,
          requires_padding=True,
          dtype=dtype,
          device=device,
      )
  
imports: import torch
  import time
  from dataclasses import dataclass
  from opentelemetry import trace
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, PreTrainedTokenizerBase
  from typing import Optional, Tuple, List, Type, Dict
  from text_generation_server.utils.tokens import batch_top_tokens
  from text_generation_server.models import Model
  from text_generation_server.models.types import GeneratedText, Batch, Generation, Tokens
  from text_generation_server.pb import generate_pb2
  from text_generation_server.utils import NextTokenChooser, StoppingCriteria, Sampling
label_desc: Use image node_id 1 to create a new Seq2SeqLM object from inherited base classes: Model with example: obj = Seq2SeqLM(model_id, revision, quantize, dtype, trust_remote_code)