code: def __init__(
      self,
      filenames: List[Path],
      device,
      dtype,
      process_group,
      aliases: Optional[Dict[str, List[str]]] = None,
      prefix: Optional[str] = None,
  ):
      routing = {}
      for filename in filenames:
          with safe_open(filename, framework="pytorch") as f:
              for k in f.keys():
                  if k in routing:
                      raise RuntimeError(
                          f"Key {k} was found in multiple files: {filename} and {routing[k]}"
                      )
                  routing[k] = filename
      if aliases is None:
          aliases = {}
      self.aliases = aliases
      self.routing = routing
      self.device = device
      self.dtype = dtype
      self.process_group = process_group
      self.prefix = prefix
      self._handles = {}
  
imports: import os
  from pathlib import Path
  from typing import List, Dict, Optional, Tuple
  from safetensors import safe_open, SafetensorError
  import torch
  from loguru import logger
  from huggingface_hub import hf_hub_download
  import json
  from text_generation_server.utils.log import log_once
label_desc: Use image node_id 1 to create a new Weights object  with example: obj = Weights(filenames, device, dtype, process_group, aliases, prefix)