code: def __init__(self, filename, load):
      global model, cache, tokenizer, generator
  
      self.filename = filename
      if load:
          with open(filename, "r") as f:
              saved = json.load(f)
      else:
          saved = {}
  
      # Running state
  
      if cache is None:
          cache = ExLlamaCache(model)
      else:
          cache.current_seq_len = 0
  
      if generator is None:
          generator = ExLlamaGenerator(model, tokenizer, cache)
      else:
          generator.reset()
  
      self.first_history_idx = 0
  
      # Saved state
  
      self.unsaved = saved.get("unsaved", True)
      self.fixed_prompt = Node(
          saved.get("fixed_prompt", default_fixed_prompt)
      )
      self.keep_fixed_prompt = saved.get("keep_fixed_prompt", True)
      self.participants = saved.get(
          "participants", ["User", "Chatbort"]
      )
  
      self.history = []
      loadhistory = saved.get("history", [])
      for jnode in loadhistory:
          self.history.append(Node(jnode))
  
      generator.settings.temperature = saved.get("temperature", 0.95)
      generator.settings.top_p = saved.get("top_p", 0.75)
      generator.settings.min_p = saved.get("min_p", 0.0)
      generator.settings.top_k = saved.get("top_k", 0)
      generator.settings.typical = saved.get("typical", 0.25)
      self.break_on_newline = saved.get("break_on_newline", True)
      generator.settings.token_repetition_penalty_max = saved.get(
          "token_repetition_penalty_max", 1.15
      )
      generator.settings.token_repetition_penalty_sustain = saved.get(
          "token_repetition_penalty_sustain", 2048
      )
      generator.settings.token_repetition_penalty_decay = saved.get(
          "token_repetition_penalty_decay", 512
      )
  
      self.max_response_tokens = saved.get("max_response_tokens", 512)
      self.chunk_size = saved.get("chunk_size", 128)
  
      # Save new session
  
      # if not load:
      self.save()
  
imports: from model import ExLlama, ExLlamaCache, ExLlamaConfig
  from tokenizer import ExLlamaTokenizer
  from generator import ExLlamaGenerator
  import time
  import torch
  import os
  import json
  import uuid
label_desc: Use image node_id 1 to create a new Session object  with example: obj = Session(filename, load)